Linux nén và giải nén file

Compress
Issue the Command: # tar cvzf backup.tar.gz /var/www

Where:

c – create backup

v – verbose output

z – compress in gzip

f – backup file name

The backup will be created in your current working directory.

Use ls command to list it

 

Uncompress

$ tar xvzf backup.tar.gz

Where,

x: This option tells tar to extract the files.

v: The “v” stands for “verbose.” This option will list all of the files one by one in the archive.

z: The z option is very important and tells the tar command to uncompress the file (gzip).

f: This options tells tar that you are going to give it a file name to work with.

Leave a Reply

You must be logged in to post a comment.