The 15th day of Linux and Me

Source: Internet
Author: User

These two days efficiency is not very high, many things look after forget, learning best can practice, so that learning can be relaxed. Don't worry, today the first two parts of the content is finished, there is no system concept of Linux, what can be done, realize what is unclear, just understand some commands, some software. Vim tomorrow, it should be more interesting.


File and file system compression and packaging

Common file name extensions:

*.gz:gzip Program compressed file;

*.bz2:bzip2 Program compressed files;

*.tar: The TAR program is packed with data that has not been compressed;

*.tar.gz:thetar program packages the files, which are compressed by gzip;

*.tar.bz2: files packaged by the TAR program, which are compressed by bzip2 .

gzip [ parameters ] 

-c-d extracted parameters, -t can be used to verify the consistency of a compressed file, to see if the file is error-free, -v can show the original file / compressed file compression ratio information, -# compression level, -1 fastest but with the worst compression, -9 slowest, but compression is best, default is -6

Zcat file name . GZ: View compressed content.

bzip2 [ parameter ] file name:

Usage andgzipSame,- Coutput The data generated by the compression process to the screen,- Ddecompression parameters,- kkeep the original file,- Zthe compressed parameters,- vcan display the original file/Compressed file compression ratio and other information,-#compression level,-1the fastest,-9slowest, the default is-6.

Bzcat file name . bz2: View compressed content.

Package command:tar

tar [Parameters] FileName:- CCreate a new package file to match- vto see the file names that were packaged during the process,- TView what file names are in the contents of a packaged file,- xunpacking or decompressing function collocation- Cin a specific directory to unlock,-jthroughbzip2the support for compression/unzip, at which time the file name is*.tar.bz2,- Zthroughgzipthe support for compression/unzip, at which time the file name is*.tar.gz,- vin the compression/During the decompression process, the file name being processed is displayed,- f filename:- Ffollowed by the processed file name,- CDirectories: Parameters are extracted in a specific directory when decompressed. - Pretain the original permissions and properties of the backup data, commonly used with backup profiles,- Pkeep the absolute path, that is, allow the backup data to contain the root directory.

Memory: Compressed tar-jxv-f filename.tar.bz2 files or directories to be compressed

Tar-zxv-f filename.tar.gz files or directories to compress

Query tar-jtv-f filename.tar.bz2

Tar-ztv-f filename.tar.gz

Unzip tar-jxv-f filename.tar.bz2-c Specify the directory to decompress

Tar-zxv-f filename.tar.gz-c Specifies the directory to extract

Full Backup tool:dump

When the backed up data is a single file system, the file system can use the full dump function, including the entire level of the 0~9 to back up, while Backups can be backed up using a mount point or a device file name.

When the backed up data is only a directory, not a single file system, there is a limit to the backup: All backup data must be under that directory, and only level 0can be used, that is, only full backups are supported and the- u parameter is not supported. You cannot create a time log file that /etc/dumpdates This level backup.

dump [Parameters] files to be backed up,- Slists how much space you need to use to back up your data,- uwill thisDumpthe time is recorded to/etc/dumpdatesin the file,- vwill beDumpThe file process is displayed,-jJoinbzip2To compress the data, the defaultbzip2compression level is2,- FsimilarTar, followed by the resulting file,- Wlisted in/etc/fstabthe inside hasDumpwhether the partition you set has been backed up.

Dumpthe reply using command isRestore,Restore [Parameters]-F dumpfile,- TViewDumpbackup files that contain important data,- Cwill beDumpthe data in the system is compared with the actual filesystem,- I.into the interactive mode, you can go to the restore part of the file, used inDumpdirectory when the restore,- Rrestores the entire file system,- HView the full backup data in theInodewith the file systemlabeland other information,- FI 'll take care of you later.Dumpdocuments,- Dwith the- Ccan be used to identify the mounting points attached to the back andDumpthere are different files within the file.

Disc Write tool:

New image file mkisofs:mkisofs [ parameter ] with backup file,-o The image file name that you want to generate,the-v Display builds the ISO process, and The files that follow the-m file are not backed up into the image files.

Disc Burning tool Cdrecord

Other common compression backup tools:

DD:dd if= "input File"of="Output File"bs="Block Size"count=" Number",bs block size, If not specified, the default is a sector ( 512bytes count how many bs

Cpio can back up anything, but Cpio will not take the initiative to find files to back up, with similar to find, such as the name can be found in the command to inform Cpio where the backup data is.

This article from "Open Can't Knock theme" blog, declined reprint!

The 15th day of Linux and Me

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.