One, file merge operation
1. Overlay symbols and append symbols
A) ">" means to overwrite the contents of the left file with the contents of the right file, and create this file if the right file does not exist.
b) ">>" represents the contents of the left file appended to the right file, if the right file does not exist, create this file
2.echo echo Command
1 Echo "I am a little shame" >t.txt2echo" I am a little ruin ">>tbak.txt
3. File Merging
1 Cat File a file B > file C
4. Number of statistics file lines
1 WC -L file
5. Pipe Break
Pass the result of the left command execution to the right action
1 Command | command
Example: Count the number of rows after merging two files
cat /etc/passwdWC -L
Second, file archiving operations
Tar command
Format:-C Create a new archive
-C go to the specified directory
-v verbose display of processed files
-F Specify an archive or device
-T lists the files in the document package
-X to expand a file from a document package
Usage:
1 tar -cvf the document package name. tar source file // package 2tar -XVF Document package name. Tar -C Specify expanded location // unpacking
Example:
1 tar -CVF test. tar /test/t.txt/test/tbak.txt/test/newtbak.txt2tar -tf test. Tar 3 tar -xvf test. Tar -c/test2
third, file compression operation
1.gzip and Gunzip
Gzip and Gunzip, respectively, are compression and decompression
Usage:
1 gzip files to compress 2 gunzip The compressed file to unzip
Example:
1 gzip Tbak.txt 2 gunzip tbak.txt.gz
2.BZIP2 and BUNZIP2
This format usage is exactly the same as Gzip
Example:
1 bzip2 T.txt 2 bunzip2 t.txt.bz2
Iv. File archive Compression operations
That is, when using file archiving operations, adding-Z to the format calls gzip compression
Usage:
1 tar -czvf xxx. Tar // Archive Compression 2 tar -xzvf xxx. tar. GZ / unpacking and unpacking
Example:
1 tar -czvf ww. Tar . GZ t.txt tbak.txt 2 tar -xzvf ww. tar. Gz-c/test2
Note: If you only want to package a directory under a file and not include this directory, you need to work in that directory.
Linux rookie take-off road "VII" file merging, archiving, and compression