Quick tips: Compress/Extract Linux directory with Tar command

To compress:

tar -zcvf archive-name.tar.gz directory-name 

-z: Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-f: Archive File name

To Extract:

tar -zxvf archive-name.tar.gz /to/bath/directory-name

-z: Compress archive using gzip program
-x: Extract files
-v: Verbose i.e display progress while creating archive
-f: Archive File name

Written on 31 January 2013

Read more on linux tar tar command unix

Share your thoughts