Pages

Saturday, February 9, 2013

how to tar a directory [ tested ] Linux


### Tar and compress a directory: 

[ includes sub-directories and files ]

For example: 

[oracle@oradb1 ~]$ echo $ORACLE_HOME 
/u01/app/product/11.2.0/dbhome_1

[oracle@oradb1 ~]$ cd /u01

[oracle@oradb1 u01]$ tar -pczf OH_backup.tar.gz app/



### Untar and uncompress:

[oracle@oradb1 ~]$ cd /u01

[oracle@oradb1 u01]$ tar xvfz OH_backup.tar.gz



### Tar multiple files:

[oracle@oradb1 bkp] tar -pczf dump2012.tar.gz psm_full.dmp psm_full.log qsm_full.dmp qsm_full.log 



### How do I untar ?

[oracle@oradb1 bkp] tar xvfz dump2012.tar.gz




No comments:

Post a Comment