sed Common Command Summary

Total number of lines to print the file:

sed -n '$ =' filename

Use the command l, the tab is shown as \ t, end of line mark displayed:

sed -n 'l' filename

The results will be displayed as:

fname\tFirst Name$
lname\tLast Name$
mname\tMiddle Name$

DOS file format to convert to Unix format to DOS newlines (CR / LF) is replaced Unix format (using sed. When the DOS file format copying on Unix, you will find that at the end of each line has a \ r \ n):

sed 's/.$//' filename

 

Guess you like

Origin www.cnblogs.com/yanwuliu/p/11791427.html