To tar a directory
tar -zcvf <tarname>.tar.gz <directory>/
- -z: Compress archive using gzip program
- -c: Create archive
- -v: Verbose i.e display progress while creating archive
- -f: Archive File name
To untar a directory
tar -zxvf <tarname>.tar.gz
To tar a directory
tar -zcvf <tarname>.tar.gz <directory>/
To untar a directory
tar -zxvf <tarname>.tar.gz