linux shell wc 命令


1. 語法與選項

Short Option Long Option Option Description
-c –bytes print the byte counts
-m –chars print the character counts
-l –lines print the newline counts
  –files0-from=F read input from the files specified by NUL-terminated names in file F
-L –max-line-length print the length of the longest line
-w –words print the word counts

2. 實例

   打印文件的行數,單詞數,字符串數

$wc file

結果:

X  Y  Z  file
#X 行數
#Y 單詞數
#Z 字符數

 

單獨打印行數

$ wc -l file

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM