head命令
作用:顯示文件的頭部內容,默認顯示前面10行
格式:
head [option] [file]
-n <行數(shù)>
-c <字節(jié)>
ghostwu@dev:~/linux/more$ head ghostwu.txt this is ghostwu how are you file thank you file thank you file thank you file thank you ghostwu@dev:~/linux/more$ head -2 ghostwu.txt this is ghostwu ghostwu@dev:~/linux/more$ cat ghostwu.txt | head -4 this is ghostwu how are you ghostwu@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 you ghostwu@dev:~/linux/more$
posted @ 2018-05-18 06:11ghostwu 閱讀(...) 評論(...) 編輯
下一個教程:linux命令(部分)