1.diff Comparison of two different files
Diff-u file file.new >file.path## generating patch files
Yum Install patch-y## installation Patching tool
Patch-b file file.path## to old software patching, clear and backup of old software
2.grep## Filter Characters
-i## or slightly case
-n## The line number of the row where the result is displayed
-c## Number of results
-v## Reverse Filter
-r Keyword Directory # # filter files in the directory with keywords
-E " keyword 1| keyword 2| ... "# # filter Multiple keywords
3.sort## Sort
-n## Pure Digital
-r## Reverse
-u## Remove Duplicate rows
-t## specifying delimiters
-k## To specify a sorted column
4.uniq## processing Duplicate rows
-c## count the number of repeating rows
-u## display Unique rows
-d## Show Duplicate rows
5.tr## convert character case
Tr ' A-Z ' A-Z ' <file## converts all lowercase characters in file to uppercase
6.sed (-I for synchronizing changes to the original file ) # # Control Flow output
Sed ' s/nologin/westos/g ' passwd # # Replace the Nologin in the output as Westos
Sed ' 1,5s/nologin/westos/g ' passwd # # Replace the nologin of 1-5 lines in the output as wesots
Sed '/games/,/nobody/s/nologin/westos/g ' passwd## replaces the nologin of the Games characters in the output to nobody characters To Westos
Sed-e ' s/nologin/westos/g '-e ' s/sbin/lee/g ' passwd## multiple substitution policies with- e connection
Sed 3d passwd## does not display the third row in the file
Sed 3,7d file## does not display 3-7 lines in a file
sed 3,7p File # # repeats 3-7 lines in Files
Sed-n 3,7p File # # displays only 3-7 lines in the files
[[email protected] mnt]# Cat rule # # rule File Contents
S/nologin/westos/g
S/sbin/lee/g
[[email protected] mnt]# sed-f rule File # # change output using rule files
1root:x:0:0:root:/root:/bin/bash
2bin:x:1:1:bin:/bin:/lee/westos
3daemon:x:2:2:daemon:/lee:/lee/westos
4adm:x:3:4:adm:/var/adm:/lee/westos
Common text Editing commands