剪掉前两行

Abs*_*cDo 0 text-processing cut text-formatting

我想检索不包括前 2 行的列表

$ pip list
Package                            Version  
---------------------------------- ---------
alabaster                          0.7.10   
anaconda-client                    1.6.9    
anaconda-navigator                 1.7.0    
anaconda-project                   0.8.2    
appnope                            0.1.0    
appscript                          1.0.1    
asn1crypto                         0.24.0   
astroid                            1.6.1    
astropy                            2.0.3    
attrs                              17.4.0   
Run Code Online (Sandbox Code Playgroud)

如何切断前两行,如:

pip list | cut line=2
Run Code Online (Sandbox Code Playgroud)

Rom*_*est 5

只需使用tail命令:

pip list | tail -n+3 -
Run Code Online (Sandbox Code Playgroud)
  • 来自tail签名tail [OPTION]... [FILE]...- 当FILE是时-,读取标准输入
  • -n, --lines=[+]NUM- 输出最后NUM一行,而不是最后 10 行;或用于-n +NUM输出以行开头NUM