av手机免费在线观看,国产女人在线视频,国产xxxx免费,捆绑调教一二三区,97影院最新理论片,色之久久综合,国产精品日韩欧美一区二区三区

操作系統(tǒng)

linux系統(tǒng)中head命令使用說明

時(shí)間:2025-02-25 21:47:44 操作系統(tǒng) 我要投稿
  • 相關(guān)推薦

linux系統(tǒng)中head命令使用說明

  head 與 tail 就像它的名字一樣的淺顯易懂,它是用來顯示開頭或結(jié)尾某個(gè)數(shù)量的文字區(qū)塊,head 用來顯示檔案的開頭至標(biāo)準(zhǔn)輸出中,而 tail 想當(dāng)然爾就是看檔案的結(jié)尾。

  1.命令格式:

  head [參數(shù)]... [文件]...

  2.命令功能:

  head 用來顯示檔案的開頭至標(biāo)準(zhǔn)輸出中,默認(rèn)head命令打印其相應(yīng)文件的開頭10行。

  3.命令參數(shù):

  -q 隱藏文件名

  -v 顯示文件名

  -c<字節(jié)> 顯示字節(jié)數(shù)

  -n<行數(shù)> 顯示的行數(shù)

  4.使用實(shí)例:

  實(shí)例1:顯示文件的前n行

  命令:

  head -n 5 log2014.log

  輸出:

  [root@localhost test]# cat log2014.log

  2014-01

  2014-02

  2014-03

  2014-04

  2014-05

  2014-06

  2014-07

  2014-08

  2014-09

  2014-10

  2014-11

  2014-12

  ==============================

  [root@localhost test]# head -n 5 log2014.log

  2014-01

  2014-02

  2014-03

  2014-04

  2014-05[root@localhost test]#

  實(shí)例2:顯示文件前n個(gè)字節(jié)

  命令:

  head -c 20 log2014.log

  輸出:

  [root@localhost test]# head -c 20 log2014.log

  2014-01

  2014-02

  2014

  [root@localhost test]#

  實(shí)例3:文件的除了最后n個(gè)字節(jié)以外的內(nèi)容

  命令:

  head -c -32 log2014.log

  輸出:

  [root@localhost test]# head -c -32 log2014.log

  2014-01

  2014-02

  2014-03

  2014-04

  2014-05

  2014-06

  2014-07

  2014-08

  2014-09

  2014-10

  2014-11

  2014-12[root@localhost test]#

  實(shí)例4:輸出文件除了最后n行的全部?jī)?nèi)容

  命令:

  head -n -6 log2014.log

  輸出:

  [root@localhost test]# head -n -6 log2014.log

  2014-01

  2014-02

  2014-03

  2014-04

  2014-05

  2014-06

  2014-07[root@localhost test]#

【linux系統(tǒng)中head命令使用說明】相關(guān)文章:

Linux系統(tǒng)中hexdump的命令匯總11-12

linux系統(tǒng)命令(經(jīng)典)01-25

linux系統(tǒng)命令11-23

Linux系統(tǒng)中strace命令的使用代碼07-01

Linux系統(tǒng)中命令的學(xué)習(xí)方法05-29

linux系統(tǒng)命令大全08-16

Linux系統(tǒng)關(guān)機(jī)的命令09-07

Linux系統(tǒng)查看命令:od命令10-24

關(guān)于Linux系統(tǒng)命令中exit與exit的區(qū)別09-19