Sunday, February 21, 2016

Linux – Command Cheat Sheet

Linux – Command Cheat Sheet

File Commands

ls                       -list directory
ls -al                   -formatted listing with hidden files
ls -ltr                  -formatted listing ordered by time
cd dir                   -change to directory
cd -                     -go to directory in previously
cd                       -go to home directory
pwd                      -show current directory path
mkdir dir                -make directory dir
rm file                  -delete file
rm -r dir                -delete directory dir
rm -f file               -force remove file
rm -rf dir               -force remove directory dir
cp file1 file2           -copy file1 to file2
cp -r dir1 dir2          -copy dir1 to dir2; create dir2 if it doesn’t exist
mv file1 file2           -rename/move file1 to file2 if file2 is an existing dir, moves file1
into dir file2
ln -s file link          -create symbolic link link to file
touch file               -create or update file
cat > file               -places standard input into file
more file                -output the contents of file
head file                -output the first 10 lines of file
tail file                -output the last 10 lines of file
tail -f file             -output the contents of file as it grows, starting with the last 10 lines


Process Management
ps                       -display your currently active processes
top                      -display all running processes
kill pid                 -kill process id pid
killall proc             -kill all processes named proc
bg                       -lists stopped or background jobs; resume a stopped job in the background
fg                       -brings the most recent job to foreground
fg n                     -brings job n to the foreground

File Permissions
chmod octal file         -change the permissions of file to octal, which can be found separately for user, group, and world by adding:
● 4 – read (r)
● 2 – write(w)
● 1 – execute (x)
Examples:
chmod 777                -read, write, execute for all
chmod 755                -rwx for owner, rx for group and world For more options, see man chmod.
chown user:group file    -change the owner and group for a file

SSH
ssh user@host            -connect to host as user
ssh -p port user@host    -connect to host on port port as user
ssh-copy-id user@host    -add your key to host for user to enable a keyed or passwordless login

Searching
grep pattern files       -search for pattern in files
grep -r pattern dir      -search recursively for pattern in dir
command | grep pattern   -search for pattern in the output of command
locate file              -find all instances of file
find . file              -find file within current directory
find / file              -find file within whole system

System Info
date                      -show the current date and time
cal                       -show this month’s calendar
uptime                    -show current uptime
w                         -display who is online
whoami                    -who you are logged in as
finger user               -display information about user
uname -a                  -show kernel information
cat /proc/cpuinfo         -cpu information
cat /proc/meminfo         -memory information
man command               -show the manual for command
df                        -show disk usage
du                        -show directory space usage
du -sk | sort -n          -show sum of each directory space usage sorted by number in KB
free                      -show memory and swap usage
whereis app               -show possible locations of app
which app                 -show which app will be run by default

Compression
tar cf file.tar files     – create a tar named file.tar containing files
tar xf file.tar           – extract the files from file.tar
tar czf file.tar.gz files – create a tar with Gzip compression
tar xzf file.tar.gz       – extract a tar using Gzip
tar cjf file.tar.bz2      – create a tar with Bzip2 compression
tar xjf file.tar.bz2      – extract a tar using Bzip2
gzip file                 – compresses file and renames it to file.gz
gzip -d file.gz           – decompresses file.gz back to file

Network
ping host                 – ping host and output results
whois domain              – get whois information for domain
dig domain                – get DNS information for domain
dig -x host               – reverse lookup host
wget file                 – download file
wget -c file              – continue a stopped download

Installation

make install
dpkg -i pkg.deb           – install a package (Debian)
rpm -Uvh pkg.rpm          – install a package (RPM)

Shortcuts

Ctrl+C                    – halts the current command
Ctrl+Z                    – stops the current command, resume with fg in the foreground
or bg in the background
Ctrl+D                    – log out of current session, similar to exit
Ctrl+W                    – erases one word in the current line
Ctrl+U                    – erases the whole line
Ctrl+R                    – type to bring up a recent command
!!                        - repeats the last command
exit                      – log out of current session

Linux – Run command as a background process

To run a command as a background process you must append & to the end of the command when issuing:

$ <command> &

If you wish the command to continue running even when you have logged off, you need to issue nohup at the beginning of the command:

$ nohup <command>

If you wish to run the command in the background even when you are logged off you should append with nohup and &:

$ nohup <command> &

Linux – Find processes running by user

To find which processes are running by a given user on linux you can issue the following:

$ ps -fu <username>

Linux – GZip decompress files

Decompress Files
To decompress files use

gzip –d, gunzip,
or
gzcat
gzip filename.txt

This will produce a compressed file called filename.txt.gz, and filename.txt will be deleted.
To decompress filename.txt.gz run the following:

gunzip filename.txt.gz

Find Perl Version
$ perl -v

How to find Operting System is 32 bit or 64 bit?

1)Linux

# uname -m
i386 or i686 then it is 32 bit
 x86_64 is 64bit

Note: Using ” uname -a ” (or -m for short) only shows the type of kernel that is running.
A 32 bit kernel ( i386, i586, i686 ) can be run on a 64 bit capable CPU.
A 64 bit kernel ( x86_64 ) requires a 64 bit capable CPU to run.

root@localhost ~]# uname -m
i686
[root@localhost ~]# file /usr/bin/file
 /usr/bin/file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
root@localhost ~]# getconf LONG_BIT
32

root@localhost ~]# uname -ar
Linux localhost.localdomain 2.6.18-194.el5PAE #1 SMP Mon Mar 29 20:19:03 EDT 2010 i686 i686 i386 GNU/Linux
root@localhost ~]# file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

root@localhost ~]# getconf WORD_BIT
32

2)Sunsolaris
 isainfo -v

How to find the number of cpu ?

1)Linux

[root@apps u02]# cat /proc/cpuinfo |grep -i processor|wc -l
4
[root@apps u02]#

 [root@apps ~]# grep -c /proc/cpuinfo -e "CPU"
 4
 [root@apps ~]#


 top  ===> press numeric 1 and observe cpu column.
 top - 08:48:31 up  6:51,  2 users,  load average: 0.11, 0.03, 0.01
 Tasks: 121 total,   1 running, 119 sleeping,   0 stopped,   1 zombie
Cpu0  :  0.3% us,  0.7% sy,  0.0% ni, 99.0% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu1  :  1.7% us,  2.4% sy,  0.0% ni, 95.9% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu2  :  3.4% us,  1.7% sy,  0.0% ni, 94.9% id,  0.0% wa,  0.0% hi,  0.0% si
Cpu3  :  0.0% us,  0.3% sy,  0.0% ni, 99.7% id,  0.0% wa,  0.0% hi,  0.0% si
 Mem:   7225436k total,  1931064k used,  5294372k free,    94796k buffers
 Swap: 15358100k total,        0k used, 15358100k free,  1645644k cached

 [root@localhost ~]# cd /sys/devices/system/cpu
 [root@localhost cpu]# ls -ltrh
 total 0
drwxr-xr-x 4 root root 0 Jan 31 19:33 cpu3
drwxr-xr-x 4 root root 0 Jan 31 19:33 cpu2
drwxr-xr-x 4 root root 0 Jan 31 19:33 cpu1
drwxr-xr-x 4 root root 0 Jan 31 19:33 cpu0
 [root@localhost cpu]#
$ cat /proc/cpuinfo | grep "^physical id" | sort | uniq | wc -l
2

To find the number of cores per CPU:

$ cat /proc/cpuinfo | grep "^cpu cores" | uniq
cpu cores : 4

The total number of processors available is the number of physical CPUs multiplied by the number of cores per CPU.
To find the total number of processors:
$ cat /proc/cpuinfo | grep "^processor" | wc -l
16

2) Sunsolaris
# /usr/platform/sun4u/sbin/prtdiag -v
Uname -x
psrinfo | grep on-line | wc -l
 6

To check the RAM size in linux.

dmesg | grep RAM

There are three another way to check memory on Linux

 1:- free -t -m
2: vmstat
3: top

Other commands for RAM :

 cat /proc/meminfo
 $ vmstat
$ vmstat -s

 # dmidecode --type memory

 Sunsolaris

 # prtconf | grep Memory
 If you want the CPU speed(s) only:
# psrinfo -v


To find only directories in Linux/Sunsolaris?

[root@apps u01]# ls -ltrh|grep -i ^d
drwxr-xr-x  4 oracle dba 4.0K Feb  7 16:19 db
drwxr-xr-x  3 oracle dba 4.0K Feb  7 17:01 oradiag_oracle
drwxrwxrwx  2 oracle dba  16K Feb  7 19:12 lost+found
 [root@apps u01]#


To find operating system version?

 [root@apps etc]# ls -tlrh /etc/redhat-release
 -rw-r--r--  1 root root 66 Nov 21  2007 /etc/redhat-release
[root@apps etc]# cat /etc/redhat-release
Enterprise Linux Enterprise Linux AS release 4 (October Update 6)
[root@apps etc]#

 [root@apps etc]# ls -tlrh /proc/version
 -r--r--r--  1 root root 0 Feb 12 08:58 /proc/version
[root@apps etc]# cat /proc/version
Linux version 2.6.9-67.0.0.0.1.ELhugemem (mockbuild@ca-build15.us.oracle.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Sun Nov 18 00:31:12 EST 2007
[root@apps etc]#

To find the trc files which are older than 30 days?

 [oracle@apps trace]$ find . -name "*.trc" -mtime +30 -exec ls -ltrh {} \;
-rw-r-----  1 oracle dba 914 Nov  8  2008 ./R1211DB1_dbrm_21512.trc
-rw-r-----  1 oracle dba 1.3K Nov  8  2008 ./R1211DB1_vktm_21506.trc
-rw-r-----  1 oracle dba 12K Nov  8  2008 ./R1211DB1_ora_21500.trc

oracle@apps trace]$ date

Tue Feb 12 09:25:47 IST 2013
 [oracle@apps trace]$


To delete the trace files older than 30 days.?

find . -name "*.trc" -mtime +30 -exec rm {} \;

To find the files more than 200MB.?

[oracle@apps ~]$ find . -name "*" -size +500000 -exec ls -ltrh {} \;
-rw-r--r--  1 oracle dba 257M Jun  6  2007 ./db/tech_st/11.1.0/md/demo/SampleData/sample_data.zip-rw-r-----  1 oracle dba 1.4G Feb 11 23:03 ./db/apps_st/data/a_txn_data01.dbf
-rw-r-----  1 oracle dba 1.5G Feb 11 23:00 ./db/apps_st/data/a_ref01.dbf
-rw-r--r--  1 oracle dba 1014M Feb 12 08:52 ./db/apps_st/data/system01.dbf
-rw-r-----  1 oracle dba 1.3G Feb 11 23:00 ./db/apps_st/data/system12.dbf


To find the req/out/log files which are more than 10Mb.

find . -name "*.req" -size +10000000c -exec ls -ltrh {} \;
 find . -name "*.out" -size +10000000c -exec ls -ltrh {} \;


Default block size in Linux

If you ever want to confirm the block size of any filesystem of  any other Linux OS.

[root@apps ~]# tune2fs -l /dev/sda1 | grep Block
Block count:              3839527
Block size:               4096
Blocks per group:         32768
 From this example, you can see that the default block size for the filesystem on /dev/sda1 partition is 4096 bytes, or 4k. That's the default block size for ext3 filesystem.


Confirm current filesystem parameters with tune2fs
The tunefs -l command will show you all the information contained in a filesystem's superblock. Here's how it typically looks:

[root@apps u02]# tune2fs -l /dev/sda1
tune2fs 1.35 (28-Feb-2004)
Filesystem volume name:   /
Last mounted on:          <not available>

Creating 0 bytes (empty) files using touch command.

syntax: touch <filename>

[root@apps u02]# touch file1 file2 file3
[root@apps u02]# ls -ld file*
-rw-r--r--  1 root root 0 Feb 12 10:04 file1
-rw-r--r--  1 root root 0 Feb 12 10:04 file2
-rw-r--r--  1 root root 0 Feb 12 10:04 file3
[root@apps u02]#

[root@apps u02]# date
Tue Feb 12 10:06:28 IST 2013
[root@apps u02]#

To change the the timestamp (date and time of modification) of a file or directory.

syntax:
touch <options> <argument> <file or directory>

touch -t  YYYYMMDDhhmm <file or directory>

Example:
root@apps u02]# date
Tue Feb 12 10:15:41 IST 2013
[root@apps u02]# ls -ld file*
-rw-r--r--  1 root root 0 Feb 12 10:04 file1
-rw-r--r--  1 root root 0 Feb 12 10:04 file2
-rw-r--r--  1 root root 0 Feb 12 10:04 file3
[root@apps u02]# touch -t 201302121016 file*
[root@apps u02]# ls -ld file*
-rw-r--r--  1 root root 0 Feb 12 10:16 file1
-rw-r--r--  1 root root 0 Feb 12 10:16 file2
-rw-r--r--  1 root root 0 Feb 12 10:16 file3
[root@apps u02]# date
Tue Feb 12 10:16:53 IST 2013

User Administration

creating an user

syntax:- useradd <options> <arguments> <username>

-u UID           -g primary grou GUID
-c comment        -d home directory
-G secondary group   -s shell
-o override

1) creating a user khaliq with default options.

root@apps u02]#  useradd khaliq

to check user has been created.

[root@apps u02]# tail -f /etc/passwd
ldap:x:55:55:LDAP User:/var/lib/ldap:/bin/false
oracle:x:500:500::/u01:/bin/bash
applmgr:x:501:500::/u02:/bin/bash
ali:x:914:914:associate:/home:/bin/csh
khaliq:x:915:915::/home/prakash:/bin/bash

2) create a user ali with the following parameters.

1)userid  914
2)comment  associate
3)home directory  /home
4)shell cshell

[root@apps u02]# useradd -u 914 -c associate -d /home -s /bin/csh ali
[root@apps u02]# tail -f /etc/passwd
postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash
fax:x:78:78:mgetty fax spool user:/var/spool/fax:/sbin/nologin
oracle:x:500:500::/u01:/bin/bash
applmgr:x:501:500::/u02:/bin/bash
ali:x:914:914:associate:/home:/bin/csh

To modify the properties of a user.

syntax:- usermod <options> <arguments> <username>

-u UID           -g primary grou GUID
-c comment        -d home directory
-G secondary group   -s shell
-o override  -l login name
-L lock the account   -U unlock the account

1) change userid of ali 750

[root@apps u02]# usermod -u 750 ali
[root@apps u02]#
[root@apps u02]# grep -i ali /etc/passwd
webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
ali:x:750:914:associate:/home:/bin/csh
[root@apps u02]#

2)Lock the account of tom.

root@apps u02]# usermod -L tom

to check logoff as root and login as tom.
3)To unlock the account of tom.
[root@apps u02]# usermod -U tom

to check logoff as root and login as tom.

4) to change the login name of user tom to jack.

[root@apps u02]# usermod -l jack tom

To delete a user

1)delete user abcxyz.

[root@apps u02]# userdel abcxyz

[root@apps home]# ls /home

prakash  raj  tom

[root@apps home]#

2)Delete the user abc along with his home directory and mailbox.

[root@apps home]# ls /home
abc xyz 123
[root@apps home]# userdel -r abc
[root@apps home]# ls /home
xyz 123

Creating a group

groupadd <groupname>
 or
groupadd <options> <argumetn> <groupname>

1)creating a group dba1 whose group id 751.

[root@apps home]# groupadd -g 751 dba1

Modifying the properties of a group.

1)change the groupid of dba1 to 800

[root@apps home]# groupmod -g 800 dba1

2)Changing the groupname of dba1 to db.

[root@apps home]# groupmod -n db dba1

Deleting the group db.

1)delete the group db.

[root@apps home]# groupdel db

[root@apps home]#

To view how long the system is running.

[root@apps home]# uptime
 11:30:47 up  9:34,  3 users,  load average: 1.10, 1.10, 1.07
[root@apps home]#

To find out hardware details.

[root@apps ~]# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter

Example's of grep command

oracle@apps ~]$ cp -r db /u02 &
[1] 26764
[oracle@apps ~]$ ps -ef|grep -i cp
root        15    10  0 02:45 ?        00:00:00 [kacpid]
root     24979     1  0 02:46 ?        00:00:00 /usr/sbin/acpid
root     26128 26106  1 02:46 ?        00:00:32 /usr/X11R6/bin/X :0 -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7

[oracle@apps u02]$ ls -ltrh
total 36K
drwxr-xr-x  3 applmgr dba  4.0K Feb  7 16:19 inst
drwxr-xr-x  4 applmgr dba  4.0K Feb  7 16:19 apps
drwxrwxrwx  2 applmgr dba   16K Feb  7 19:12 lost+found
drwxr-xr-x  2 root    root 4.0K Feb 12 10:02 stage
-rw-r--r--  1 root    root    0 Feb 12 10:16 file3

[oracle@apps u02]$ rm -rf db &
[1] 26807
[oracle@apps u02]$ ps -ef|grep -i rm
root     26592     1  0 02:47 ?        00:00:21 /usr/bin/gnome-terminal
oracle   26807 26737  5 03:49 pts/2    00:00:00 rm -rf db
oracle   26809 26737  0 03:49 pts/2    00:00:00 grep -i rm
[oracle@apps u02]$

you can also check whether job is running or not.

[oracle@apps u02]$ jobs
[1]+  Running                 rm -rf db &

To stop remove job use kill cmd.

kill -9 process id
kill -9 26807

To check pmon is running or not.

[oracle@apps appsutil]$ ps -ef|grep -i pmon
oracle    1393 26737  0 04:11 pts/2    00:00:00 grep -i pmon
oracle   27379     1  0 03:53 ?        00:00:00 ora_pmon_PROD
[oracle@apps appsutil]$

To check fnd and http processes are running or not.

[applmgr@apps scripts]$ ps -fu applmgr|grep -i fnd|wc -l
12
[applmgr@apps scripts]$ ps -fu applmgr|grep -i http|wc -l
11
[applmgr@apps scripts]$


To check history.

[applmgr@apps scripts]$ history|grep -i fndcpass
  686  ps -fu applmgr|grep -i FNDCPASS
  687  ps -fu applmgr|grep -i FNDCPASS
  688  ps -fu applmgr|grep -i FNDCPASS
  712  history|grep -i fndcpass
[applmgr@apps scripts]$ history|grep -i adstrtal
   20  ./adstrtal.sh apps/apps
   25  ./adstrtal.sh apps/apps


You can also use fc -l cmd to check history in linux or Sunsolaris.

[applmgr@apps scripts]$ fc -l
699      ps -fu applmgr|grep -i http|awk '{print "kill -9",$2}'
700      kill -9 28298
701      kill -9 28303
702      kill -9 28304
703      kill -9 28309

Using grep command in fc -l.
[applmgr@apps scripts]$ fc -l|grep -i ps|head
698      ps -fu applmgr|grep -i http|wc -l
699      ps -fu applmgr|grep -i http|awk '{print "kill -9",$2}'
711      ps -fu applmgr|grep -i http|wc -l

How to check if a Port is listening for any Service?Checking webserver port no in the below example.

[applmgr@apps scripts]$ grep -i s_login $CONTEXT_FILE
         <login_page oa_var="s_login_page">http://apps.user.com:8000/OA_HTML/AppsLogin</login_page>

[applmgr@apps scripts]$ netstat -an|grep -i 8000
tcp        0      0 0.0.0.0:8000                0.0.0.0:*                   LISTEN
[applmgr@apps scripts]$


Also you can check with lsof (list of open files).

[applmgr@apps scripts]$ lsof |grep -i 8000
httpd     27226 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
rotatelog 27235 applmgr   10w      REG        8,2      210   11846940 /u02/inst/ apps/PROD_apps/logs/ora/10.1.3/Apache/error_log.1360800000
rotatelog 27236 applmgr   11w      REG        8,2     1056   11846827 /u02/inst/ apps/PROD_apps/logs/ora/10.1.3/Apache/access_log.1360800000
httpd     27239 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
httpd     27241 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
httpd     27244 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
httpd     27245 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
httpd     27246 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
httpd     27247 applmgr   18u     IPv4      33089                 TCP *:8000 (LI STEN)
[applmgr@apps scripts]$

egrep example

[applmgr@apps ~]$ egrep -i 's_login|s_applcsf|s_applout|s_appllog|s_applptmp|s_appltmp' $CONTEXT_FILE
         <login_page oa_var="s_login_page">http://apps.user.com:8000/OA_HTML/AppsLogin</login_page>
         <APPLCSF oa_var="s_applcsf">/u02/inst/apps/PROD_apps/logs/appl/conc</APPLCSF>
         <APPLLOG oa_var="s_appllog">log</APPLLOG>
         <APPLOUT oa_var="s_applout">out</APPLOUT>
         <APPLTMP oa_var="s_appltmp">/u02/inst/apps/PROD_apps/appltmp</APPLTMP>
         <APPLPTMP oa_var="s_applptmp" osd="UNIX">/usr/tmp</APPLPTMP>


How can I find out if my processor is 64 bit or 32, under linux?

Look for lm (Long Mode) under flags - if you can see it, you have a 64 bit CPU, if not, it is a 32 bit one.

[root@apps ~]# cat /proc/cpuinfo

OR

[root@apps ~]# cat /proc/cpuinfo|grep -i lm
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht nx rdtscp lm pni popcnt
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht nx rdtscp lm pni popcnt
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht nx rdtscp lm pni popcnt
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht nx rdtscp lm pni popcnt
[root@apps ~]#

Look for lm (Long Mode) under flags - if you can see it, you have a 64 bit CPU, if not, it is a 32 bit one.

How to check all mount pints of a server ?

[oracle@devuser u02]$ df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G  6.9G  6.8G  51% /
none                  2.2G     0  2.2G   0% /dev/shm
/dev/sda5             4.9G  344M  4.3G   8% /tmp
/dev/sda2              39G  2.4G   35G   7% /u01

How to make tar?
i have a share mount point that is backup and you must be in oracle directory to make it tar.
in the below example it is taking input as 11.2.0 and sending the output to backup location.

nohup tar -cvf - 11.2.0 | gzip -c > /backup/share/1120.tar.gz &
nohup tar -cvf - appl | gzip -c > /backup/share/appl.tar.gz &
nohup tar -cvf - 10.1.2 | gzip -c > /backup/share/1012.tar.gz &
nohup tar -cvf - 10.1.3 | gzip -c > /backup/share/1013.tar.gz &
nohup tar -cvf - comn | gzip -c > /backup/share/comn.tar.gz &

How to untar?

you must be in oracle directory.

cd /u02/oracle
under oracle directoy 11.2.0 directory will  be untar.as the gunzip command taking the input from backup location
and making under it from where you fired the command in my case oracle directory.
cd /u02/oracle
gunzip -c /backup/share/1120.tar.gz | tar -xvf - &

No comments:

Post a Comment