The seq command linux

The seq command linux

seq.

seq 1 5 |tac
The seq command linux

Open the file with vi or vim when the
input of the next command mode again
: set nu
will display line numbers
The seq command linux

Use sed command to print certain
data representation cancel the default print -n

sed -n 20,30p tt.txt

The seq command linux

Sed can also print using only one row
sed -n 30p tt.txt -n represents the default print cancel

The seq command linux

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

The seq command linux

Sed good summary line
awk good column

awk -F ":" '{print $ 1}' / etc / passwd by: printing a first row delimiter

The seq command linux

$ 0 is print the entire line

The seq command linux

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

The seq command linux

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

The seq command linux

Find all the files and then modify the
find / -type f -name "ett.txt" | xargs sed -is # oldboylinux # oldboywindows # g

The seq command linux

Guess you like

Origin blog.51cto.com/13800637/2439865