Linux command-----Backup and compression

Source: Internet
Author: User
Tags bz2

# dd IF=/DEV/SDA | gzip-c | ssh [email protected] ' dd of=/mnt/backups/sda.dd '//SSH copy entire hard drive to remote directory (with compression)

# TAR-C creates the package;-X releases the package;-V shows the command process;-Z is the compressed package;-t lists the package files (should be packaged with relative paths instead of absolute paths)

# TAR-CVF Wxr.tar WXR//Package the current WXR directory

# TAR-CVF Wxr.tar wxr--exclude ' *.3dv '--exclude ' *.3dh '--exclude ' *.cgm '--exclude ' *.INP '//Package the current WXR directory and exclude. 3DV,. 3DH, . CGM,. inp files

# TAR-ZCVF apache.tar.gz--exclude=c--exclude=d Apache//If the/opt/apache/directory has a,b,c,d directory, only package A, B directory, not packaging C, D directory

# TAR-ZCVF wxr.tar.gz WXR//package compression for current WXR directory

# TAR-HCVF Wxr.tar wxr//The link file in the directory wxr is also packaged

# TAR-RVF Wxr.tar file1//Add File to Wxr.tar package file1

# TAR-TF Wxr.tar//view package Wxr.tar content

# TAR-TZF wxr.tar.gz//View the contents of a compressed package wxr.tar.gz

# tar-jtv-f WXR.TAR.BZ2//View the contents of a compressed package wxr.tar.bz2

# tar-jcv-f WXR.TAR.BZ2 bar///pack the directory bar and compress it to wxr.tar.bz2

# tar-jxv-f WXR.TAR.BZ2//Decompression Package wxr.tar.bz2 Recovery

# tar-jxv-f Wxr.tar.bz2-c bar///Unzip the package to the directory bar/

# TAR-XVF Wxr.tar-c/home//Recovery package Wxr.tar to the specified directory/home

# TAR-XVF Wxr.tar//Unpacking package Wxr.tar

# TAR-XZF Wxr.tar.gz-c/home//Recover compressed package wxr.tar.gz to the specified directory/home (without the-C restore to the original directory)

# TAR-XZF wxr.tar.gz//Unpacking package wxr.tar.gz

# TAR-XZF wxr.tar.gz blah.txt//Extract files from compressed package wxr.tar.bz2 Blah.txt

# TAR-ZCVF Wxr.tar.gz/project//package and Compress directory Project

# TAR-ZXVF WXR.TAR.GZ//Compressed package file Decompression Recovery

# Tar Cvf-dir1 dir2 | (CD/DIR3; tar xvf-)//release the current directory Dir1 Dir2 Edge package edge to/dir3 directory

# for ARK in./*.tar.gz; Do tar xvf $ARK; Done//Unzip all the. tar.gz files in the current directory (assign the file name of all the. tar.gz files in the current directory to the variable ark, and let tar refer to the Ark variable)

# dump-0f Home.dump/home//Back up the/home directory to a file home.dump

# dump-0j-f/ROOT/ETC.DUMP.BZ2/ETC//backup/etc Directory with compression function

# RESTORE-RVF Home.dump//Restore Home Directory

# RESTORE-TF Home.dump//View a list of files home.dump the backup file

# DUMP-W//See if any file system has been dump data

# zip-r Data.zip Data//Compress Data folder into Data.zip format

# Unzip Data.zip//extract data.zip files to the current folder

# zip-r Yasuo.zip abc.txt dir1//Put a file Abc.txt and a directory Dir1 compressed into Yasuo.zip

# Unzip Yasuo.zip//unzip Yasuo.zip file

# unzip abc\? ZIP//Unzip the Abc1.zip,abc2.zip and Abc3.zip in the current directory (?) to represent a character, if any number of characters are represented by *

# unzip-v Large.zip//No pressure, just want to see the contents of the compressed file Large.zip

# unzip-t Large.zip//Verify that the compressed file Large.zip is completely downloaded

# unzip-j Music.zip//With the-v option found in Music.zip there are multi-level directories, and subdirectories are MP3 files, if you want to download these files to the first level of the directory, rather than a layer of building a directory


Linux command-----Backup and compression

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.