<em id="0a85b"><option id="0a85b"></option></em>

<abbr id="0a85b"></abbr>

      <nobr id="0a85b"></nobr>
        <tr id="0a85b"></tr>
        9久久伊人精品综合,亚洲一区精品视频在线,成 人免费va视频,国产一区二区三区黄网,99国产精品永久免费视频,亚洲毛片多多影院,精品久久久无码人妻中文字幕,无码国产欧美一区二区三区不卡
        學習啦 > 學習電腦 > 操作系統 > Linux教程 > Linux系統中wc命令的用法詳解

        Linux系統中wc命令的用法詳解

        時間: 佳洲1085 分享

        Linux系統中wc命令的用法詳解

          在Linux系統中,wc命令不太經常用到,只是在統計字數的時候才會使用該命令,那么下面由學習啦小編為大家整理了linux系統中wc命令的詳細解釋的相關知識,希望對大家有幫助!

          Linux系統中wc命令的用法詳解

          1.命令格式:

          wc [選項]文件…

          2.命令功能:

          統計指定文件中的行數、字數、字節數,并將統計結果顯示輸出。該命令統計指定文件中的行數、字數、字節數。如果沒有給出文件名,則從標準輸入讀取。wc同時也給出所指定文件的總統計數。

          3.命令參數:

          -c 統計字節數。

          -l 統計行數。

          -m 統計字符數。這個標志不能與 -c 標志一起使用。

          -w 統計字數。一個字被定義為由空白、跳格或換行字符分隔的字符串。

          -L 打印最長行的長度。

          --help 顯示幫助信息

          --version 顯示版本信息

          Linux系統中wc命令的具體實例

          實例1:查看文件的字節數、字數、行數

          命令:

          wc test.txt

          輸出:

          [root@localhost test]# cat test.txt

          hnlinux

          peida.cnblogs.com

          ubuntu

          ubuntu linux

          redhat

          Redhat

          linuxmint

          [root@localhost test]# wc test.txt

          7 8 70 test.txt

          [root@localhost test]# wc -l test.txt

          7 test.txt

          [root@localhost test]# wc -c test.txt

          70 test.txt

          [root@localhost test]# wc -w test.txt

          8 test.txt

          [root@localhost test]# wc -m test.txt

          70 test.txt

          [root@localhost test]# wc -L test.txt

          17 test.txt

          說明:

          7 8 70 test.txt

          行數 單詞數 字節數 文件名

          實例2:用wc命令怎么做到只打印統計數字不打印文件名

          命令:

          輸出:

          [root@localhost test]# wc -l test.txt

          7 test.txt

          [root@localhost test]# cat test.txt |wc -l

          7[root@localhost test]#

          說明:

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

          實例3:用來統計當前目錄下的文件數

          命令:

          ls -l | wc -l

          輸出:

          [root@localhost test]# cd test6

          [root@localhost test6]# ll

          總計 604

          ---xr--r-- 1 root mail 302108 11-30 08:39 linklog.log

          ---xr--r-- 1 mail users 302108 11-30 08:39 log2012.log

          -rw-r--r-- 1 mail users 61 11-30 08:39 log2013.log

          -rw-r--r-- 1 root mail 0 11-30 08:39 log2014.log

          -rw-r--r-- 1 root mail 0 11-30 08:39 log2015.log

          -rw-r--r-- 1 root mail 0 11-30 08:39 log2016.log

          -rw-r--r-- 1 root mail 0 11-30 08:39 log2017.log

          [root@localhost test6]# ls -l | wc -l

          8

          [root@localhost test6]#

          說明:

          數量中包含當前目錄

          知識擴展:Linux系統中wc命令的-help說明

          建議用--help查看使用說明:

          Usage: wc [OPTION]... [FILE]...

          or: wc [OPTION]... --files0-from=F

          Print newline, word, and byte counts for each FILE, and a total line if

          more than one FILE is specified. With no FILE, or when FILE is -,

          read standard input. A word is a non-zero-length sequence of characters

          delimited by white space.

          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 length of the longest line

          -w, --words print the word counts

          --help display this help and exit

          --version output version information and exit

          單詞:

          Usage:用法

        3636699 主站蜘蛛池模板: 一亚洲一区二区中文字幕| 噜噜噜亚洲色成人网站∨| 天天在线看无码AV片| 可以在线观看的亚洲视频| 一本一道中文字幕无码东京热| 无码熟妇人妻av在线电影| 无码人妻h动漫| 亚洲欧洲综合| 日本一区不卡高清更新二区| 成人自拍小视频在线观看| 久久国产一区二区日韩av| 在线 欧美 中文 亚洲 精品| 国产免费高清69式视频在线观看 | 国产亚洲精品线观看动态图| 国产99视频精品免费专区| 91精品国产高清久久久久久g| 久久精品国产高潮国产夫妻| 最近免费中文字幕大全| 欧美人与动zozo在线播放| 亚洲熟女乱色综合一区| 欧美日韩午夜| 国产男人的天堂在线视频| 欧美专区日韩视频人妻| 国产高清自产拍av在线| 久久久久亚洲AV无码专| 2021国产精品视频网站| 好吊色妇女免费视频免费| 国产精品妇女一区二区三区 | 国产99视频精品免视看9| 最新国产精品精品视频| 成人午夜大片免费看爽爽爽| 亚洲乱码一二三四区国产| 亚洲日韩精品无码一区二区三区| 日韩av毛片在线播放| 九九热在线视频免费观看| 成人在线视频一区| 麻豆麻豆麻豆麻豆麻豆麻豆| 亚洲中文久久久精品无码| 人妻内射一区二区在线视频| 精品久久久中文字幕人妻| 日韩在线视频线观看一区|