Linux cat命令

小疙瘩的飛飛魚發表於2020-11-20

介紹

cat命令經常會用來檢視一個檔案的內容,並且結合它本身的一些引數經常可以用來做一些特殊的內容處理。

 

 

引數

Usage: cat [OPTION]... [FILE]...
Concatenate FILE(s), or standard input, to standard output.

  -A, --show-all           等同於使用引數-vET
  -b, --number-nonblank    針對非空行顯示行號
  -e                       等同於使用引數 -vE
  -E, --show-ends          每行以$結尾
-n, --number 每行都顯示行號 -s, --squeeze-blank 將連續的多個空行以顯示一個空行 -t 等同於使用引數 -vT -T, --show-tabs 製表符(tab)以^I符合代替 -u (ignored) -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB --help display this help and exit --version output version information and exit With no FILE, or when FILE is -, read standard input. Examples: cat f - g Output f's contents, then standard input, then g's contents. cat Copy standard input to standard output.

 

1.檢視多個檔案內容

2.顯示行號

3.壓縮空行

4.不顯示空行

 

總結

 

 

 

 

備註:

    作者:pursuer.chen

    部落格:http://www.cnblogs.com/chenmh

本站點所有隨筆都是原創,歡迎大家轉載;但轉載時必須註明文章來源,且在文章開頭明顯處給明連結。

《歡迎交流討論》

相關文章