1. File compression principle: At present, the use of computer systems are measured in units of bytes, but, in fact, the computer should be the smallest unit of measurement bits fishes, in addition, we also know 1byte = 8bits. That each byte will be among eight spaces, each space can be 0 or 1, so if we want to record this number 1, it will be wasted another seven spaces. The compression technology is through a number of algorithms, these controls do not throw out used to make files smaller footprint. Another compression technique to duplicate data for statistical records. For example, 1111 ...... 1 Total 100 1, the compression technology will be recorded as 100 1, instead of the actual storage 100 1.
2. File and compression suffix:
1) * Z:. Compress file compression program
2) * gz:. Gzip compressed program files
3) * bz2:. Bzip2 compressed archive program
4) * tar:. Tar packaged data and not compressed.
5) * tar.gz:. Tar packaged file, and after gzip compressed
6) * tar.bz2:. Tar packaged files, and through the bzip2 compression
On 3.linux common compression instruction is gzip and bzip2, compress As already quit popular. gzip is the GNU project developed out of the directive, which has replaced the compre. Later, the GNU has developed a bzip2 compression better compression ratio instruction. However, these instructions are usually only for a file compression and decompression, this way, each compression and decompression to be a lot of files. Therefore, it can be packaged with tar. Many packaged tar file into a file, or even a directory. Just pure tar package features.
4.compress [-rcv] file or directory: Very old command, you need to install ncompress software. gzip can unlock this directive compressed files.
1) -r: can compress files directory along with
2) -c: the compressed data output to the screen, you can> filename saved to the specified file, the source file still exists
3) -v: File information can be displayed and some compressed file name changes compressed
By default, the source files are compressed files replaced.
uncompress files .Z: unzip the file, it will remove the suffix unpacked, restore the source files.
5.gzip [-cdtv #] filename; zcat filename .gz: archive compression and decompression, parameters:
1) -c: the compressed data to the screen, directing the flow of data can be processed through
2) -d: plus compression parameters
3) -t: it can be used to verify the consistency of a compressed file, see the file for errors
4) -v: it can show the original file / file compression ratio and other information
5) - #: compression level, -1 fastest, but worst compression ratio, -9 slowest, but best compression ratio, the default is -6, enter a number in place of #
By default the command will compress files to .gz suffix file name, the source file no longer exists. In addition to the instruction files can also be compressed winrar decompression software under windos.
zcat This command can read files gzip compressed
6.bzip2 [-cdkzv #] filename, bzcat filename .bz2: provides better compression than gzip program parameters:
1) -c: the compressed data generated during output to the screen
2) -d: decompression parameters
3) -k: keep the source file, but does not delete the original file
4) -z: compression parameters
5) -v: You can show the original files / compress files compression ratio and other information
6) - #: gzip and the same, the compression ratio parameters are calculated, -9 best, -1 fastest
bzcat: can also read a compressed file.
7.tar [-jz] [cv] [-f filename establish] filename: packing and compression
tar [-jz] [tv] [-f filename establish]: Show file name
tar [-jz] [xv] [-f filename establish] [-C directory]: Extract
1) -c: the establishment of its archive, can be used with -v to see the process of being packaged wipe filename
2) -t: view the package contents of the file filename What
3) -x: unpack or unzip functionality, it can be used with -C solved in a specific directory
Special Note: -c, -t, -x can not occur simultaneously in one instruction
4) -j: so through support bzip2 compression / decompression: At this time last file name for the * .tar.bz2
5) -z: so through support gzip compression / decompression: At this point the best name for the file tar.gz
6) -v: compression / decompression process, the file name being displayed
7) -f filename: -f back immediately to take the file name to be treated
8) -C directory: This option is used in decompression, to compress the solution in a specific directory, you can use this option
9) -p: Keep backups of the original data and attribute authority, often used to back up important configuration files
10) -P: Reserved absolute path, that allows backup data exists in the root directory containing meaning
11) - exclude = FILE: During compression, do not tell FILE pack.
Compression: tar -jcv -f filename.bar.bz2 to be a compressed file or directory name
Query: tat -jtv -f filename.tar.bz2
Decompressing: tar -jxv -f filename.tar.bz2 -C want unzipped
Position of the j may also be replaced by representatives -z gzip compression.
8.dump [-Suvj] [-level] [-level] [-f backup file] files to be backed up; dump W: parameters,
1) -S: Lists only data to be backed up behind the space required to complete the backup
2) -u: the time recorded to the dump etc / dumpdates file
3) -v: the process dump file is displayed
4) -j: added support bzip2 will compress the data, the default is bzip2 compression class 2
5) -level: rating from -0 to -8
6) -f filename: followed by the file produced by
7) -W: listed in the partition having a dump set etc / fstab inside if there is backed up
9.restore -r [-f dumpfile]: restore the entire file system parameters:
1) -t: This is used for viewing dump up any important data backup file containing
2) -C: This mode can dump the data within the system out for comparison with the actual file
3) -i: enters interactive mode, you can restore only part of the file, with the reduction in the directory when the dump
4) -r: a model for the entire file system restore, with the reduction in the dump file system for backup
5) -h: View full backup data inode file system label information
6) -f: take that back to your dump file to be processed
7) -D: -C to match with, you can find out the mount point followed by the inner dump has a different file.
10.mkisofs [-o image file] [- rv] - file [m file] to be backed up ... [-V vol] -graft-point isodir = systemdir ..., parameters:
1) -o: followed by the file name of the image file you want to generate
2) -r: generating Unix / Linux file data through Rock Ridge, can record more information
3) -v: Display build ISO process
4) -m file: -m meant to exclude files behind the file is not backed up to an image file
5) -V vol: the establishment of Volume, a bit like Windos Explorer in the CD title to see things
6) -graft-point: graft or transplant have passed on meaning,
11.cdrecord: CD burning command
12.dd -if = inputfile of = outfile bs = blocksize count = number: parameters,
1) if: file is backed up, the device may also be
2) of: target file is backed up, it may be a means
3) bs: Planning a block size, if not specified, the default 512bytes
4) count: How many bs meaning
13.cpio -ovcB> [file | device] backup; cpio -ivcdu < [file | device] reduction; cpio -ivct < [file | device] to view the parameters:
1) -o: copy the data to the output file or device
2) -B: Let preset Blocks can be increased to 5120bytes, the default is 512bytes, which would allow faster access to large files
3) -i: data from the file system or device to copy them
4) -d: automatically create a directory
5) -u: Automatically newer files overwrite older files
6) -t: need to meet the -i option is available in the "View" the contents of files created with cpio or devices
7) -v: Let the stored procedure in the file name can be displayed on the screen
8) -c: a relatively new portable format stored