4. Sed 行数控制

  • sed -n ‘1d’ files

就是删除第一行

  • ‘2,5p’ 表示 prints all the lines from 2 to 5

  • ($) which represents the last line of the file

  • ‘2,+4 p’ books.txt 从第二行开始打印出后面4行

  • ‘M~n’ 50~5 matches line number 50, 55, 60, 65, and so on.

猜你喜欢

转载自blog.csdn.net/successdd/article/details/79078051
sed