Hack 49. Combine gzip, bzip2 with tar
by Ramesh
How to use gzip with tar?
Add option z to the tar command when dealing with tar.gz compressed file.
- # tar cvfz /tmp/my_home_directory.tar.gz /home/jsmith
- # tar xvfz /tmp/my_home_directory.tar.gz
- # tar tvfz /tmp/my_home_directory.tar.gz
Note: Using gzip is faster when compared to bzip2.
How to use bzip2 with tar?
Add option j to the tar command when dealing with tar.bz2 compressed file.
- # tar cvfj /tmp/my_home_directory.tar.bz2 /home/jsmith
- # tar xvfj /tmp/my_home_directory.tar.bz2
- # tar tvfj /tmp/my_home_directory.tar.bz2
Note: Using bizp2 gives higher level of compression when compared to gzip.
当前内容版权归 Ramesh Natarajan 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Ramesh Natarajan .