What's the opposite of head? I want all but the first N lines of a file

前端 未结 8 675
时光说笑
时光说笑 2020-12-07 19:55

Given a text file of unknown length, how can I read, for example all but the first 2 lines of the file? I know tail will give me the last N lines, but

相关标签:
8条回答
  • 2020-12-07 20:22

    tail -n +linecount filename will start output at line linecount of filename, so tail -n +3 filename should do what you want.

    0 讨论(0)
  • 2020-12-07 20:24

    A simple solution using awk:

    awk 'NR > 2 { print }' file.name
    
    0 讨论(0)
提交回复
热议问题