linux打印指定的行的内容

  • 使用sed打印第99行
sed -n '99,p' test.txt
  • 使用awk打印第99行
awk 'NR==99' test.txt
awk 'FNR==99' test.txt
  • perl 完成
perl -lane 'if($.==99){print $_}' test.txt
原文地址:https://www.cnblogs.com/raisok/p/10955056.html