Wednesday

Basic Unix Commands for an Oracle DBA

Here are some useful operating system commands on unix as an Oracle dba:

 1)How to copy a file called file1 to another file called file2?

cp file1 file2





2)How to delete a file called file1?


rm file1


3)How to delete a directory called dir1?


rm -r dir1


4)How to open a file called file1 for editing?


vi file1


5)How to edit the file called file1 after opening it ?


press the letter i on your keyboard to start editing.
when you dont want to edit press the esc(escape) key on your keyboard


6)How to save the changes after editing a file?


press esc key on your key board
press the : key on your keyboard
type wq and then press enter key on your keyboard


7)How to close the file without saving the changes?


press esc key on your keyboard
press the : key on your key board
now type q! and then press the enter key on your keyboard


8)How to see the details of a file called file1 without using the vi editor?


more file1


9)How to find out information of any unix command?


use the man utility on the unix server.
example  man cp
this will give you explanation about what cp is


10)When using the man command ,how can you come out of the man window?


press the q key on your keyboard
or
press the control key and then keeping it pressed , also press the c key on your keyboard.


11)How to go into a folder or change into a directory called dir1 on the unix machine?


cd dir1


12)Suppose you are in the directory dir1 and the complete path is /opt/oracle/dir1.Now
how can you come back into the previous directory (which from the above line is the
oracle directory)?


cd ..


13)How can you see the contents of a directory?


go into the directory using the cd yourdirectory path command
example cd /opt/oracle/dir2
then type ls -l
then press the enter key
you can also the ls -ltr command


14)How can you create a file called file1 on a unix server?


type the command  touch file1
Then press the enter key


15)How can you move a file called file1 which is in the directory /opt/oracle to the
directory /opt/oracle/server?


type the below command and then press the enter key on your keyboard
mv /opt/oracle/file1  /opt/oracle/server


 



No comments:

Post a Comment