linux按行取文件

  • 文件前几行 head -n 5 $file
  • 文件后几行 tail -n -5  $file
  • 文件从第几行到结尾 tail -n +5 $file
  • 区间行的文件 sed -n '2,5p' $file   # 第二行到第5行

posted on 2022-01-12 17:42  BioinformaticsMaster  阅读(50)  评论(0编辑  收藏  举报

导航