显示特定行

head

-n, --lines=[-]K
              print the first K lines instead of the first 10; with  the  leading
              ‘-’, print all but the last K lines of each file
tail
-n, --lines=K
              output  the  last  K lines, instead of the last 10; or use -n +K to
              output lines starting with the Kth
 
hg log | sed -n "15,+20p"
 

语法:wc [选项] 文件…

说明:该命令统计给定文件中的字节数、字数、行数。如果没有给出文件名,则从标准输入读取。wc同时也给出所有指定文件的总统计数。字是由空格字符区分开的最大字符串。

该命令各选项含义如下:

  - c 统计字节数。

  - l 统计行数。

  - w 统计字数。

 

原文地址:https://www.cnblogs.com/air-of-code/p/4778923.html