0% found this document useful (0 votes)
692 views16 pages

UNIX - Linux Commands For Oracle DBAs DBA TEAM - Vikram Gurung - Academia PDF

Uploaded by

Shankar Pujari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
692 views16 pages

UNIX - Linux Commands For Oracle DBAs DBA TEAM - Vikram Gurung - Academia PDF

Uploaded by

Shankar Pujari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

 Search...

Log In Sign Up

UNIX/Linux Commands for Oracle DBAs DBA TEAM


Uploaded by
 top 2%  705     Info  Download    PDF
Vikram Gurung
 

UNIX/Linux Commands for Oracle DBAs

DBA TEAM

Revision History 

Date Revision Name Reviewer


13/05/013 1.0 VikramGrg Ashish Man. Baisyet

Basic File Navigation

df  command in Linux provides disk space usage information of your file systems.

$ df –h (in human readable format)

[oracle@asmdb ~]$ df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 30G 19G 8.6G 69% /

/dev/sda1 99M 9.9M 84M 11% /boot

tmpfs 2.0G 295M 1.8G 15% /dev/shm

du command
Display how much disk space is being used by directories.

[oracle@asmdb asmsoft]$ du -ak /softwares/asmsoft/

-a - Shows counts for all files encountered, not only directories.
-k - Use 1024 byte blocks instead of the default 512.

Basic File Navigation


Head command prints the first N number of data of the given input. By default, it prints first 10
lines of each given file.

tail 
Show last lines of a file.
$tail -500 alert.log #Print only the last 500 lines of the alert log file. 

man
man

The Linux command "man" is used at the command line to explain the functions and definitions
of other commands commonly used within Linux. The term "man" is short for manual pages
and gives you a very in-depth explanation of the said command which you are referring to.

$ man ls

$ man chown
"pwd" command displays the present working directory.

[oracle@asmdb ~]$ pwd


/u01/app/oracle/product/11.2.0/dbhome_1

The "ls" command lists all files and directories in the specified directory. If no location is defined
it acts on the current directory.

[oracle@asmdb ~]$ ls

[oracle@asmdb ~]$ ls
[oracle@asmdb ~]$ ls –
/u01
al

$ ls –l or ll (Listing in long format).

The "-a" flag lists hidden "." files.

The "-l" flag lists file details (Listing in long format).

"cd" command -> change directories.

[oracle@asmdb ~]$ cd /u01/app/oracle

[oracle@asmdb oracle]$ pwd


/u01/app/oracle

"touch" -> create a new empty file.

[oracle@asmdb ~]$ touch my.log

vi Editor

The default editor that comes with the UNIX/Linux operating system is called vi (visual editor)
 

[oracle@asmdb ~]$ vi filename.txt

The vi editor has three modes, command mode, insert mode and command line mode.

1.  Command mode: letters or sequence of letters interactively command vi. Commands


are case sensitive. The ESC key can end a command.
2.  Insert mode: Text is inserted. The ESC key ends insert mode and returns you to

command mode.
(insert at end One "o"
of line), can (open
enter insert mode
new line with
after the "i"
current (insert),
line) or "O""a" (insert
(Open lineafter),
above"A"
current line) commands.
3.  Command line mode: One enters this mode by typing ":" which puts the command line
entry at the foot of the screen.

To Exit vi 
Usually the new or modified file is saved when you leave vi. However, it is also possible
to quit vi without saving the file.

* :x<Return>  Save and quit vi. 

:wq<Return> Write and quit vi .

:q<Return>  quit (or exit) vi .

* :q!<Return>  quit vi even though latest changes have not been saved for this vi call

cat ->Display one or more files contents.


[oracle@asmdb ~]$ cat pfile1.ora

"rm" command -> to delete files and directories.

[oracle@asmdb ~]$ rm my.log


[oracle@asmdb ~]$ rm -rf /softwares/asmsoft1

Recursively(-r) deletes directories and subdirectories with contents forcefully(-f) without


prompt.

"mv" command -> move/rename files and directories.

[oracle@asmdb ~]$ mv myfile.log myfile_bk.log


[oracle@asmdb ~]$ mv * /softwares/asmsoft/
[oracle@asmdb ~]$ mv /archive/arch_bk/* .
Job Board About Press Blog Stories Terms Privacy Copyright  We're Hiring!  Help Center

Academia © 2015

You might also like