wc 命令使用說明

2022-05-22 12:42:11 字數 1565 閱讀 1184

wc 命令 使用說明

wc 命令還是很是簡單的,通過 man 命令,可以見到可以選擇的選項:

wc option file 

並且 wc 命令支援 管道操作

其中較為常用的命令選項

-c 字元的個數

-l 檔案的行數

-w 單詞的個數

小例子:

➜  ~ wc -l /etc/passwd

47 /etc/passwd

➜ ~ wc -c /etc/passwd

2549 /etc/passwd

➜ ~ wc -w /etc/passwd

104 /etc/passwd

➜ ~

name

wc - print newline, word, and byte counts for each file

synopsis

wc[option]... [file]...

wc [option]... --files0-from=f

description

print newline, word, and

byte counts for each file, and a total line if

more than one file is specified. a word is a non-zero-length sequence of char

‐ acters delimited by white space.

with no file, or when file is -, read standard input.

the options below may be used to

select

which counts are printed, always in the following order: newline, word, character, byte

, maximum line length.

-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; if f is - then

read names from standard input

-l, --max-line-length

print the maximum display width

-w, --words

print the word counts

--help display this help and exit

--version

output version information and exit

linux diff 命令使用說明

1 diff命令的功能 linux中diff命令的功能為逐行比較兩個文字檔案,列出其不同之處。它對給出的檔案進行系統的檢查,並顯示出兩個檔案中所有不同的行,不要求事先對檔案進行排序。2 語法 diff options file1 file2 該命令告訴使用者,為了使兩個檔案file1和file2一致...

scp命令使用說明

scp是linux常用的命令,它可以方便的進行檔案的傳輸。利用scp進行檔案傳輸時,通過指定的加密演算法還可以提公升傳輸速度。scp secure copy 允許不同的主機之間進行檔案傳輸。scp使用ssh進行資料的傳輸,提供了和ssh相同的身份認證和同一級別的安全策略。從本地複製單個檔案 scp ...

Trap命令使用說明

trap命令用於指定在接收到訊號後將要採取的行動。trap命令的一種常見用途是在指令碼程式被中斷時完成清理工作。可以使用trap l來檢視具體訊號列表。trap捕捉到訊號之後,可以有三種響應方式 trap commands signal listtrap signal listtrap signal...