seq.
seq 1 5 |tac
Open the file with vi or vim when the
input of the next command mode again
: set nu
will display line numbers
Use sed command to print certain
data representation cancel the default print -n
sed -n 20,30p tt.txt
Sed can also print using only one row
sed -n 30p tt.txt -n represents the default print cancel
Use the awk command to print a piece of content to achieve common use awk awk '{}' single quotes curly braces write logic NR line number $ 0 for
the qualified print out the contents
awk '{if(NR>19&&NR<31) print $0 }' tt.txt
Sed good summary line
awk good column
awk -F ":" '{print $ 1}' / etc / passwd by: printing a first row delimiter
$ 0 is print the entire line
sed change the contents sed s ### content is written between the file name sg g intermediate the first three pound pound pound sign and the second is to be replaced
Between the second and third wells number asked content is replaced pound of
sed s # oldboylinux # oldboywindows # g ett.txt
Here we are just modify the output of the contents of the original file is not modified
If you want to modify
need to add parameters -i
sed oldboylinux the -is # # # G ett.txt oldboywindows
Find all the files and then modify the
find / -type f -name "ett.txt" | xargs sed -is # oldboylinux # oldboywindows # g