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

前端 未结 8 678
时光说笑
时光说笑 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:01

    tail --help gives the following:

      -n, --lines=K            output the last K lines, instead of the last 10;
                               or use -n +K to output lines starting with the Kth
    

    So to filter out the first 2 lines, -n +3 should give you the output you are looking for (start from 3rd).

提交回复
热议问题