How does “(head; tail) < file” work?

前端 未结 4 855
攒了一身酷
攒了一身酷 2020-12-25 12:30

(via https://stackoverflow.com/a/8624829/23582)

How does (head; tail) < file work? Note that cat file | (head;tail) doesn\'t.

Al

4条回答
  •  梦谈多话
    2020-12-25 13:01

    head command display first 10(default) lines of file. And tail command display last 10(default) lines of file. Suppose if the file has only 3 lines also no problem those command will display those lines. But if you have more than 10 lines, then both command will display default 10 lines only. The default number of lines will be changed by using -n, n, +n options. (refer man page)

提交回复
热议问题