如,我想看/etc/profile文件的前5行里的第5行。

则,   head -5 /etc/profile  |  tail -1 

  管道|啊,很简单,就是把左边命令的结果,作为右边的输入。

 

  如,我想看/etc/profile文件的后5行的第1行

则,  tail -5 /etc/profile  |   head 1

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案