中文字幕亚洲第一精品|精品国产免费一区二区|久久婷婷五月六月综合版|中文字幕熟妇久久久人妻|久久综合精品国产一区无码|国产成人精品永久免费视频|午夜亚洲国产精品理论片a级|久久精品一区二区三区无码护土

 訪問(wèn)手機(jī)版  

Linux常用命令|Linux培訓(xùn)學(xué)習(xí)|考試認(rèn)證|工資待遇與招聘,認(rèn)準(zhǔn)超級(jí)網(wǎng)工!

招聘|合作 登陸|注冊(cè)

網(wǎng)絡(luò)工程師培訓(xùn)

當(dāng)前位置:網(wǎng)絡(luò)工程師 > 技術(shù)課程 > linux > 熱點(diǎn)關(guān)注 > linux常用命令

linux命令大全_linux命令分類大全_linux命令大全進(jìn)程

時(shí)間:2019-09-01

linux命令大全進(jìn)程_linux命令大全_linux命令分類大全

Linux系統(tǒng)中的wc(Word Count)命令的功能為統(tǒng)計(jì)指定文件中的字節(jié)數(shù)、字?jǐn)?shù)、行數(shù)linux命令大全,并將統(tǒng)計(jì)結(jié)果顯示輸出。

1.命令格式:

wc[選項(xiàng)]文件...

2.命令功能:

統(tǒng)計(jì)指定文件中的字節(jié)數(shù)、字?jǐn)?shù)、行數(shù)linux命令大全,并將統(tǒng)計(jì)結(jié)果顯示輸出。該命令統(tǒng)計(jì)指定文件中的字節(jié)數(shù)、字?jǐn)?shù)、行數(shù)。如果沒(méi)有給出文件名,則從標(biāo)準(zhǔn)輸入讀取。wc同時(shí)也給出所指定文件的總統(tǒng)計(jì)數(shù)。

3.命令參數(shù):

-c統(tǒng)計(jì)字節(jié)數(shù)。

-l統(tǒng)計(jì)行數(shù)。

-m統(tǒng)計(jì)字符數(shù)。這個(gè)標(biāo)志不能與-c標(biāo)志一起使用。

-w統(tǒng)計(jì)字?jǐn)?shù)。一個(gè)字被定義為由空白、跳格或換行字符分隔的字符串。

-L打印最長(zhǎng)行的長(zhǎng)度。

-help顯示幫助信息

--version顯示版本信息

linux命令大全進(jìn)程_linux命令大全_linux命令分類大全

4.使用實(shí)例:

實(shí)例1:查看文件的字節(jié)數(shù)、字?jǐn)?shù)、行數(shù)

命令:

wctest.txt

輸出:

[root@localhosttest]#cattest.txt

hnlinux

peida.cnblogs.com

ubuntu

ubuntulinux

redhat

Redhat

linuxmint

linux命令分類大全_linux命令大全_linux命令大全進(jìn)程

[root@localhosttest]#wctest.txt

7870test.txt

[root@localhosttest]#wc-ltest.txt

7test.txt

[root@localhosttest]#wc-ctest.txt

70test.txt

[root@localhosttest]#wc-wtest.txt

8test.txt

[root@localhosttest]#wc-mtest.txt

70test.txt

[root@localhosttest]#wc-Ltest.txt

17test.txt

說(shuō)明:

linux命令大全_linux命令大全進(jìn)程_linux命令分類大全

7870test.txt

行數(shù)單詞數(shù)字節(jié)數(shù)文件名

實(shí)例2:用wc命令怎么做到只打印統(tǒng)計(jì)數(shù)字不打印文件名

命令:

輸出:

[root@localhosttest]#wc-ltest.txt

7test.txt

[root@localhosttest]#cattest.txt|wc-l

7[root@localhosttest]#

說(shuō)明:

使用管道線,這在編寫shell腳本時(shí)特別有用。

實(shí)例3:用來(lái)統(tǒng)計(jì)當(dāng)前目錄下的文件數(shù)

命令:

linux命令大全進(jìn)程_linux命令分類大全_linux命令大全

ls-l|wc-l

輸出:

[root@localhosttest]#cdtest6

[root@localhosttest6]#ll

總計(jì)604

---xr--r--1rootmail30210811-3008:39linklog.log

---xr--r--1mailusers30210811-3008:39log2012.log

-rw-r--r--1mailusers6111-3008:39log2013.log

-rw-r--r--1rootmail011-3008:39log2014.log

-rw-r--r--1rootmail011-3008:39log2015.log

-rw-r--r--1rootmail011-3008:39log2016.log

-rw-r--r--1rootmail011-3008:39log2017.log

[root@localhosttest6]#ls-l|wc-l

8

[root@localhosttest6]#

說(shuō)明:

數(shù)量中包含當(dāng)前目錄

 上一個(gè)教程:linux下的mail命令