如何在没有第一行的情况下显示结果

tak*_*hin 0 ubuntu bash text grep pipe

当我运行一些 bash 命令时,它返回2..n文本行(n每次都不同,可能包含空行)。

如何过滤输出以显示跳过第 1 行和第 2 行的结果?

例如

$ my_command

file1
file2
file3
file3

$ my_command | some_filter

file3
file4
Run Code Online (Sandbox Code Playgroud)

EEA*_*EAA 8

$ my_command | tail -n +3
Run Code Online (Sandbox Code Playgroud)

在这种情况下,+3意思是“在文件的第三行开始输出”。

  • `我的命令| 尾 -n +3` (2认同)
  • @ErikA:似乎对我必须处理的 centos 和 ubuntu 系统很重要。ls | tail +3 tail: 无法打开 +3 读取:没有那个文件或目录 (2认同)