linux shell wcコマンド

804 ワード

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