Linux Tar Compressed archive Management Command Learning

Source: Internet
Author: User
Tags bz2


Tar is the main file compression and decompression, is a more commonly used command.

Command format:

tar [-cxtzjvfppn] pathname [pathname ...]


-C: Create an archive

-X: Unlocking an Archive

-T: View an archived content

-Z: Archive compression or decompression with gzip

-j: Compress or decompress archive with bzip2

-V: Show detailed process

-F: Use file name, followed by file name directly

-r: Append file to end of file

--delete: Deleting files from files

-P: Do not change the original properties of the file

-N: Archive only updated files, followed by date (YYYY/MM/DD)

--exclude file: Do not package the following files


1, packaging/home but not compression


2, to gzip compression and packaging


3. Compress and pack with BZIP2


4, view the tar file content


5, view the content of gzip files,


6, view bzip2 file contents


7, back up the/home directory and save permission settings


8, Backup/home in the directory than the 2009/05/28 new files

Tar-n "2009/05/28"-zcvf/filepath/filename.tar.gz/home

9, Backup/home directory, but do not back up the/home/slyar directory


10, back up the/home directory for home.tar.gz, only extract/home/ files

TAR-ZXVF home.tar.gz home/

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.