How to extract a part of the compressed file

Post Reply
a24uall
Site Admin
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

How to extract a part of the compressed file

Post by a24uall »

How to extract a part of the big compressed file.

View the files in the backup tar archive.
tar -tvzf filename.tar.gz
You can also grep a part

root@d02-03-2-4 [/backup/cpbackup/daily]# tar -tvzf filename.tar.gz | grep mysql
drwx------ root/root 0 2015-03-10 07:58:40 filename/mysql/
-rw-r--r-- root/root 2240337 2015-03-10 07:58:40 filename/mysql/omoley_database.sql
-rw-r--r-- root/root 1432 2015-03-10 07:58:39 filename/mysql/omoley_database.create
-rw------- root/root 5 2015-03-10 07:58:36 filename/mysql/openfileslimit
How to extract a specific compressed file.
Here : backup-3.17.2014_23-35-48_arun/mysql/misaghi2_misaghi_wrdp3.sql
root@server [/backup]# tar -zxvf backup-3.17.2014_23-35-48_arun.tar.gz backup-3.17.2014_23-35-48_arun/mysql/misaghi2_misaghi_wrdp3.sql
backup-3.17.2014_23-35-48_arun/mysql/misaghi2_misaghi_wrdp3.sql
root@server [/backup]#
Arun
WebhostingDevelopment.com
Post Reply

Return to “COMPRESSION / DECOMPRESSION”