In Oracle : Linux, UNIX commands for DBAs 

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

Linux, UNIX, AIX, Windows

In-Oracle.com  -> Linux, UNIX, ...

-> Linux, UNIX commands for DBAs

 

 Linux, UNIX commands for DBAs

 

 

pwd - The "pwd" command displays the current directory

 

pwd
/home/oracle

 

which - The "which" command displays the full path of (shell) commands.

 

which zip
/oracle/db/11.2/bin/zip
 

 

ls - The "ls" command list directory contents

 

ls -altr
 

total 112
-rw-r--r-- 1 oracle dba 310 Feb 15 2008 smit.transaction
-rw-r--r-- 1 oracle dba 171 Feb 15 2008 smit.script
-rw-r--r-- 1 oracle dba 1440 Feb 15 2008 smit.log
drwxr-x--- 3 oracle dba 256 Feb 15 2008 .java
-rw-r--r-- 1 oracle dba 875 Feb 18 2008 sqlnet.log
-rw------- 1 oracle dba 55 May 17 14:42 .vi_history
drwxr-xr-x 2 oracle dba 256 May 19 14:13 .p
-rw-r--r-- 1 oracle dba 356 May 27 14:29 .rhosts
-rw------- 1 oracle dba 212 May 28 10:33 old.Xauthority
drwx------ 2 oracle dba 256 May 28 12:32 .ssh
drwxr----- 3 oracle dba 256 Jul 4 11:38 oradiag_oracle
drwxr-xr-x 6 bin bin 256 Jul 8 14:55 ..
drwxr-xr-x 2 oracle dba 4096 Jul 15 21:39 .vnc
-rw------- 1 oracle dba 263 Jul 15 21:39 .Xauthority
drwxr-xr-x 7 oracle dba 4096 Jul 15 21:39 .
-rwxr----- 1 oracle dba 868 Jul 27 19:32 .profile
-rw------- 1 oracle dba 10866 Aug 2 09:59 .sh_history
 

 


cp - The "cp" command is used to copy files and directories

 

cp [option] SOURCE   DEST

 

cp file1.txt file2.txt
cp * /archive     (the source = *   ---> from current directory; the destination = /archive )
cp /archive/* .   (the source =/archive/* ;  the destination is = .  ---> the current directory)

 

 

mv - The "mv" command is used to move or rename files and directories

 

mv file1.txt file2.txt
mv * /archive     (the source = *   ---> from current directory; the destination = /archive )
mv /archive/* .   (the source =/archive/* ;  the destination is = .  ---> the current directory)

 

 

rm - The "rm" command is used to delete files and directories

 

ls
Dir1 file1.txt
rm file1.txt
ls
Dir1
rm -R Dir1
ls
 

You can use -R in order to remove a directory.

 

 

cd - The "cd" command is used to change directories

 

/home/oracle/myDir>pwd
/home/oracle/myDir
/home/oracle/myDir>cd ../
/home/oracle>cd myDir
/home/oracle/myDir>
 

 

mkdir - The "mkdir" command is used to create new directories

 

mkdir Mydir

 

 

find - The "find" command can be used to find the location of specific files

 

find $ORACLE_HOME -name listener.ora
/oracle/db/11.2/network/admin/samples/listener.ora
 

 

umask - The "umask" command can be used to set the creation file permisions for an (OS) user

 

The umask value is subtracted from the default permissions (666) to give the final/ real permission:
 

666 : Default permission
002 : - umask value
664 : final permission

 

 

chmod - The "chmod" command can be used to change the file permisions

 

chmod 777 myfile.txt

 

Owner      Group      The others    Permission

   7               7               7              read + write + execute
   6               6               6              write + execute
   5               5               5              read + execute
   4               4               4              read only
   2               2               2              write only
   1               1               1              execute only

 

 

chown - The "chown" command is used to change the ownership of files

 

chown oracle:dba tnsnames.ora

chown -R oracle:dba /oracle/base

 

 

ps - The "ps" command lists current process information

 

ps -ef | grep smon

 

 

kill - The "kill" command stop a specific OS process

 

kill -9 3009

 

3009 is the process ID

 

 

uname - The "uname" commands can be used to get information about the host

 

uname -a
AIX dev2rac 3 5 00C7FE6E4C00
 

AIX         = the OS

dev2rac    = hostname

3              = OS release

5              = OS version

 

 

gzip - The Linux/ UNIX/ AIX version of zip utility

 

gzip file1
gunzip file1.gz

 

 

compress - Another Linux/ UNIX/ AIX utility used to compress a file.

 

compress file1
uncompress file1.Z

 

 

In-Oracle.com  -> Linux, UNIX, ...

-> Linux, UNIX commands for DBAs

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

 

     Copyright (c) 2011-2015  www.in-oracle.com  |  Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk.