1. Find the contents of the file (e.g. account number: zh123456): Grep;ls
Mode 1 Find all Files: grep zh123456 *
Mode 2 recursive lookup: ls | Xargs grep zh123456
Mode 3 Recursive lookup: Find. -name ' apf44_zswmpay* ' |xargs grep applog|awk-f ": ' {print $} ' |sort |uniq-c
2. Find out if there is a file in your directory (for example, if you want to find 20170914xzh.txt): find
2.1 Way 1 Fuzzy match lookup: find. -name "*20160106/*xzh.txt"
2.1 Way 2 Recursive lookup: Find. -name ' apf44_zswmpay* ' |xargs grep applog|awk-f ": ' {print $} ' |sort |uniq-c
3. Packaging and Unpacking command: Tar
3.1. Packaging: Tar Czvf/back/baklog/int44-log20170914.tar.gz/app/int44/log
3.2. Unpacking: Tar Xzvf/back/baklog/int44-log20170914.tar.gz/app/int44/log
3.3. Check that the package column indicates the fineness and size: Tar tzvf/back/baklog/int44-log20170914.tar.gz
4. Find out if the account number in the file is non-numeric (as an example of a problem encountered at Work Zhongshan Telecom batch file format check): awk
4.1 Check the account for non-numeric presence: awk ' BEGIN {fs= ' \004 ';} nr>1 {print NR ":" $ file.name |grep-e "[^0-9|:]+]
4.2 Count the 5th column amount and: awk ' BEGIN {fs= ' |; Total=0} nr>1 {total=total+$5} end{printf "total:%.2f\n", total} ' 20170914.txt
5. View usage space: DF;d u
5.1 Way 1:DF-HL
5.2 Way 2:DU-SM * | Sort-n//Statistics current directory size and size sorting
6. Character set conversion and hexadecimal display text: Iconv,od,xxd,stat
6.1:iconv-f utf-8-T GBK 20170630.txt//Convert files from Utf-8 to GBK on screen display
6.2:od-x 20170630.txt//hexadecimal display of text content, the first 3 bytes for the encoding type (different operating systems, the display is not the same)
6.3:xxd 20170630.txt//Displays text content in hexadecimal and displays the encoding and the original
6.4:stat 20170630.txt//View the last access time of the file, last modified time
7.md5sum: Generate MD5 ciphertext
7.1:md5sum p_00403030705002017101120427.txt (file name)//0228d736b69436fcb054051431b9c7d386
Common shell commands