unix - head AND tail of file

前端 未结 20 1215
误落风尘
误落风尘 2020-12-07 11:05

Say you have a txt file, what is the command to view the top 10 lines and bottom 10 lines of file simultaneously?

i.e. if the file is 200 lines long, then view lines

20条回答
  •  感情败类
    2020-12-07 11:30

    head -10 file.txt; tail -10 file.txt

    Other than that, you'll need to write your own program / script.

提交回复
热议问题