Basic usage of tar command to (de)compress gz/bz2/xz files
tar
is a popular command-line tool used for archiving files. It is commonly used for creating backups, compressing files, and transferring files between different systems. Tar can create a single archive file that contains many files and directories, making it easy to move and manage large amounts of data.
Supported compression formats:
- gzip (.gz)
- bzip2 (.bz2)
- xz (.xz)
.tar.gz
# compress
tar zcf FILE.tar.gz FILEDIR
# decompress
tar zxf FILE.tar.gz
.tar.bz2
# compress
tar jcf FILE.tar.bz2 FILEDIR
# decompress
tar jxf FILE.tar.bz2
.tar.xz
# compress
tar Jcf FILE.tar.xz FILEDIR
# decompress
tar Jxf FILE.tar.xz
Leave a message
Disclaimer
- Welcome to visit the knowledge base of SRE and DevOps!
- License under CC BY-NC 4.0
- Made with Material for MkDocs and improve writing by generative AI tools
- Copyright issue feedback me#imzye.com, replace # with @