iSelfSchooling.com - Copyright © 1999-2009 iSelfSchooling.com ||  References  |  Job Openings
    Home  | Search more...  |  FREE Online VIDEO Oracle Training 

   Unlimited access!   

    Oracle  Syntax  | Suggestions

Copyright & User Agreement

Email2aFriend  | Homepage us! |  Bookmark

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

 

Subject:  Quick UNIX and LINUX notes for Oracle DBAs (must know)

 

More Resources by Google:

Quick UNIX and LINUX notes for Oracle DBAs

The following are the most common commands that you, as a DBA,

may use them in the UNIX or LINUX environments.

INDEX

alias

at

cal

cat

cd

chggrp

chmod

chown

chsh

clear

cmp

compress

cp 

date

df

diff

du

echo

ftp 

grep

gzip

jobs

ls 

make 

man

mkdir 

more 

mv

passwd

ps

ping

pwd 

rm

rmdir 

tail 

tar 

telnet

whereis

who 

zip

 

 

alias
Create an alias to display all files in the current directory. unalias cancels the alias.

Example:

$ls                                                           #Display all files and directory in the current directory (note the format).

$ls –al                                                     #Notice on the differences.

$alias ls='ls -al'                                          #Create an alias to display all files in the current directory.

$ls                                                           #Execute the ls command alias.

$unalias ls                                             #Un-alias the ls command.

Back to index

 


at

Execute a command at a specified time.

Example:

$ls –al > testjob                                    #Save ‘ls –al’ output into the testlsal file.

$echo ‘cp testjob testjob2’ > jobrun                #Write a program to copy file and name it jobrun.

$chmod 700 jobrun                    #Give read, write, and execute access permission to owner.

$date                                                      #Check the date – assuming the time is 10:25.

$at –f jobrun 10:30                       #Schedule to run the job after 5 minutes.

$ls –l testjob*                                       #After 5 minutes, you should get the copy of your file.

Back to index

 


cal

Display the calendar of the current month  

$cal                                                         #Display the current month calendar.

$cal 2003                                                # Display the calendar of the year 2003

Back to index

 


cat

Display one or more files.  

Example:

$touch test                                            #Create a file named test.

$ls –al > test                                          #Copy the output of ‘ls –al’ command into the test file.

$cat -n test                                            #Display the test file with numbers in ascending order in front of each line.

Back to index

 


cd

Change the current directory.
Example:

$cd                                                          #Change the current directory to the user default home directory.

$cd /u01/app/oracle/product/9.1.3                #Change the current directory to /u01/app/oracle/product/9.1.3

Back to index

 


chggrp

Change group of the named file or directory.

Example:

$su root                                                 #su to root.

$ls –al > test                                          #Write ‘ls –al’ output into the test file.

$ls –l test                                               #Display all information about the test file.

$chgrp oracle test                                                #Change the group ownership of the test file.

$ls –l test                                               #Display again the test file information using the long list format (-l)

Back to index

 


chmod

Set file access permissions.
Example:

$ls –al > test                                          #Write ‘ls –al’ output into the test file.

$ls –l test                                               #Note on the test file access permissions.

$chmod ugo+rwx test                         #Give read, write, and execute access to owner, group and other users.

$ls –l test                                               #Note on the test file access permissions.

$chmod u+rw,g+r test                         #Give read and write access to owner, read access to group, and nothing to group

$ls –l test                                               #Note on the test file access permissions.

Back to index

 


chown

Change the owner of a file or directory.

Example:

$su root                                                 #su to root.

$ls –al > test                                          #Write ‘ls –al’ output into the test file.

$ls –l test                                               #Note that who owns the file.

$chown oracle test                         #Give the ownership of test file to oracle user.

$ls –l test                                               #Note that who owns the file.

Back to index

 


chsh

Change the Unix shell you log into.

$chsh –l                                                 #List all of the installed shells in your machine.

$chsh –s /bin/ksh                                                #Change the current user shell to the korn shell.

Back to index

 


clear

Clears the display. Only the prompt is displayed.

Example:

$ls –al                                                     #Display all files’ name and directories in the current folder.

$clear                                                      #Clear the screen.

Back to index

 


cmp

Compares files.

Example:

$ls –al > testlsal                                    #Save ‘ls –al’ output into the testlsal file.

$ls –l > testlsl                                        #Save ‘ls –l’ output into the testlsl file.

$cmp testlsal testlsl                     #compare the testlsal file with the testlsl file.

$cmp testlsal testlsal                   #compare the testlsal file with itself.

Back to index

 


compress

Compress the named file. The compressed file gets .Z appended to the filename.
Example:

$ls –al > testcompress                        #Save ‘ls –al’ output into the testlsal file.

$ls –l testcompress                        #Check the file size.

$compress –v testcompress                #Compress the file and display compress messages (-v).

$ls –l testcompress                        #Check the file size.

$more testcompress                        #Check the compress file.

$uncompress testcompress                        #Uncompress the file.

Back to index

 


cp

The cp command allows you to copy files to new files, or copy files and directories to new directories.

-i - Ask before updating a file or directory that exists in the destination with the same name.
-r - To copy a directory including its contents to a new directory, recursive.

Example:

$ls –al > testcopy                                 #Save ‘ls –al’ output into the testcopy file.

$mkdir copydir                                      #Create a copy directory.

$cp -i testcopy ./copydir                                #Copy the testcopy file into the copydir directory.

$cp -i testcopy ./copydir                                #Repeat this and see the difference.

$ls –al ./copydir                                    #Check to see your file was copied.

$mkdir copydir2                                    #Create another directory.

$cp -r ./copydir/* ./copydir2                #Copy all the files from the copydir directory to the copydir2 directory.

$ls –al ./copydir2                                  #Check to see your file(s) was/were copied.

Back to index

 


echo

Echo argument.

Example:

$echo ‘this statement’                             #Display or echo ‘this statement.’

$GLOBLVAR=’my 2nd test’                #Define a Global variable and assign a value to it.

$export GLOBALVAR                       #Export the value.

$echo $GLOBALVAR                     #Display or echo the content of your global variable.

Back to index

 


date

List current date and time

Example:

$date                                                      #Display time on the output device.

$date > testdate                                    #Write date on the created testdate file.

$more testdate                                      #Display the testdate content.

$echo ‘Date is in top’ >> testdate                #Append the ‘Date is in top’ message in the testdate file.

$more testdate                                      #Display the testdate file.

Back to index

 


df
Shows disk space available on the system (-k  Use 1024 byte blocks instead of the default 512).
Example:

$df –k                                                     #Display all space available on the system.

Back to index

 


diff

Display the differences between two text files.

Example:

$ls –al > testlsal                                    #Save ‘ls –al’ output into the testlsal file.

$ls –l > testlsl                                        #Save ‘ls –l’ output into the testlsl file.

$diff testlsal testlsl                     #compare the testlsal file with the testlsl file.

$diff testlsal testlsal                   #compare the testlsal file with itself.

Back to index

 


du

Display how much disk space is being used by directories.
-a - Shows counts for all files encountered, not only directories.
-k - Use 1024 byte blocks instead of the default 512.  

Example:

$du –k /u03/app/oracle                    #Display disk space used in the /u03/app/oracle directory by directories.

$du –ak /u03/app/oracle                    #Display disk space used in the /u03/app/oracle directory by files and directories.

Back to index


ftp

FTP to a site (or IP address)
Example:

ftp 205.204.23.176                 #Copy a file from one machine to anothers.

ftp> get myfile.txt /u03/oradata/myfile.txt

fpt> put myfile.txt /u05/oradata/myfile.txt

fpt> bye

 

/opt/sfw/bin/wget http://......  #copy or ftp file from one server to another using the URL address.

 

Back to index

 


grep

Searchs for a string in a file.

Example:

$ps –ef|grep ora_                                 #Show only those process that start with ora_

$ls –al |grep oracle                     #Display all the lines that has oracle word in it.

Back to index

 


gzip

Compress a file.

Example:

$ls –al > testcompress                        #Save ‘ls –al’ output into the testlsal file.

$ls –l testcompress                        #Check the file size.

$gzip testcompress                        #Compress the testcompressfile.

$ls –l testcompress                        #Check the file size.

$more testcompress                        #Check the compress file.

$gunzip testcompress                        #Uncompress the file.

Back to index

 


jobs

Display active processes.

Example:

$jobs                                                      #Show the list active jobs.

Back to index

 


ls

Show files in the current directory ls, ls -l (Displays the file details), ls -a (Displays hidden files), (hidden files in UNIX begin with a dot (.)), the current directory and parent directory entries (. and .. respectively).

Example:

$ls                                                           #Show all files and directories.

$ls –l                                                       #Show all files and directories in long format.

$ls –al                                                     #Display all files and directories plus the hidden files.

Back to index

 


make

Compile a source code.

Example:

$make your_source_program                #Compile your source program.

Back to index

 


man

Read the help man command
Example:

$man cp                                                 #Help information for ‘cp’ command.                                     

Back to index

 


mkdir

Create a directory.

 -i parameter will make the system prompt you before deleting a file or directory.

Example:

$cd /u03/oradata                                  #Change the directory to the /u03/oradata directory.

$mkdir –i  userdata                 #Make a directory called userdata and prompt if exist.

$ls –al                                                     #Check that the directory was created.

$rmdir userdata                                     #Remove the directory.

Back to index

 


more

View a file.

Example:

$more testcopy                                     $Display a file and pause. Enter space key to go to next page.

Back to index

 


mv

Rename or move a file.

Example:

$ls –al > testmove                                #Save ‘ls –al’ output into the testmove file.

$mkdir movedir                                     #Create the movedir directory.

$mv -i testmove ./movedir                               #Move the testmove file into the movedir directory. Prompt if it is duplicate.

$ls –al ./movedir                                   #Check to see your file was moved.

Back to index

 


passwd

Change password.

Example:

$passwd                                                #Change the current password to the new password.

Back to index

 


ping

Ping an IP address.

Example:

$ping mymachine                                 #Ping using dsn name.

$ping 127.0.0.1                                      #Ping using ip address.

Back to index

 


ps

Display processes status.

Example:

$ps –ef|grep ora_                                 #Display all the processes that start with ora_

Back to index


pwd

What is the current directory.

Example:

$pwd                                                      #Display the current directory name.

Back to index

 


rm

Delete/remove a file.

Example:

$ls –al > testremove                            #Save ‘ls –al’ output into the testremove file.

$ls –l testremove                                  #Check the testremove file exists.

$rm testremove                                     #Remove the file.

$ls –l testremove                                  #Check again to see the testremove file exists.

Back to index

 


rmdir

Remove a directory.

Example:

$cd /u03                                                 #Change directory to /u03

$mkdir myfolder                                    #Create the myfolder directory in the current folder.

$cd myfolder                                         #Change the current folder to the new created folder.

$df –k > myfirstfile                              #Create a file.

$cd ..                                                       #Go back to /u03

$rmdir myfolder                                    #Notice that when you remove the directory, it must be empty.

$rmdir –r myfolder                                #Use r parameter that to remove files or directories recursively.

Back to index

 


tail

Show last lines of a file.

Example:

$ls –al > testtail                                    #Save ‘ls –al’ output into a file named ‘testtail.

$ls –al >> testtail                                  #Append the output one more time.

$ls –al >> testtail                                 #Append the output again.

.. do the above step number of times. May be 3 more times.

$cat –n testtail                                      #Get a feel that how big your file is now (-n option will print the line number).

$tail -5 testtail                                       #Print only the last 5 lines of the testtail file.

Back to index

 


tar

Archive files.

Example:

$ls –al > test_tar                                   #Save ‘ls –al’ output into a file named ‘test_tar.

$ls –al >> test_tar                                #Append the output one more time.

$ls –al >> test_tar                                #Append the output again.

.. do the above step number of times. May be 3 more times.

$ls –l test_tar                                        #Check the size.

$tar –cvf                test_tar.tar test_tar  #Create a tar file and name it test_tar.tar.

$ls –l test_tar*                                      #Check to see that the tar file was created (-c option will create tar file).

$rm test_tar                                           #Remove the test_tar file.

$tar –xvf  test_tar.tar                             #Un-tar the test_tar.tar file.

$ls –l test_tar                                        #Notice that the file is back.

Back to index

 


telnet

Connect to a server by hostname (using dns) or IP address.

Example:

$telnet 155.55.143.12                         #Telnet to a server using IP address.

$telnet hostname                                  #Telnet to a server using dns hostname.

Back to index

 


whereis

Locate the binary, source, and manual page files.

Examples;

$ls –al > findme                                    #Save ‘ls –al’ output into a file named ‘findme.’

$cd /                                                       #Change the directory to root.

$whereis findme                                   #Find the created file.

Back to index

 


who

Who are loged in?

Example:

$who                                                      #Display all users that are loged in.

$w                                                           #Display all users that are loged in and what they doing.

$whoami                                                #Display who am I.

$id                                                           #Display who am I.

Back to index

 


zip

Compress to zip for IBM files.

Example:

$ls –al > test_zip                                  #Save ‘ls –al’ output into a file named ‘test_zip’.

$zip test_zip                                          #Compress to zip for IBM files.

Back to index

 

fsck -F vxfs -y -o full,nolog /dev/vx/rdsk/helpdg/helpdgvol02

 
 
Google
 
Web web site