head命令
作用:显示文件的头部内容,默认显示前面10行
格式:
head [option] [file]
-n <行数>
-c <字节>
ghostwu@dev:~/linux/more$ head ghostwu.txt this is ghostwuhow are youfile thank youfile thank youfile thank youfile thank youghostwu@dev:~/linux/more$ head -2 ghostwu.txt this is ghostwughostwu@dev:~/linux/more$ cat ghostwu.txt | head -4this is ghostwuhow are youghostwu@dev:~/linux/more$ head -c 10 ghostwu.txt this is ghghostwu@dev:~/linux/more$ cat -n ghostwu.txt | head 1 this is ghostwu 2 3 4 how are you 5 6 7 file thank you 8 file thank you 9 file thank you 10 file thank youghostwu@dev:~/linux/more$