精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學習啦>學習電腦>操作系統(tǒng)>Linux教程>

      linux cat命令使用方法

      時間: 志藝942 分享

        cat 一直從標準的輸入讀,直到你設定的分界符時就停止讀,把讀的內容輸出到指定的文件或者終端接下來是小編為大家收集的linux cat命令使用方法,歡迎大家閱讀:

        linux cat命令使用方法

        cat主要有三大功能:

        1.一次顯示整個文件。

        $ cat filename

        2.從鍵盤創(chuàng)建一個文件。

        $ cat > filename

        只能創(chuàng)建新文件,不能編輯已有文件.

        3.將幾個文件合并為一個文件。

        $cat file1 file2 > file

        使用方式:cat [-AbeEnstTuv] [--help] [--version] fileName

        說明:把檔案串連接后傳到基本輸出(屏幕或加 > fileName 到另一個檔案)

        參數(shù):

        -n 或 --number 由 1 開始對所有輸出的行數(shù)編號

        -b 或 --number-nonblank 和 -n 相似,只不過對于空白行不編號

        -s 或 --squeeze-blank 當遇到有連續(xù)兩行以上的空白行,就代換為一行的空白行

        -v 或 --show-nonprinting

        范例:

        cat -n textfile1 > textfile2 把 textfile1 的檔案內容加上行號后輸入 textfile2 這個檔案里

        cat -b textfile1 textfile2 >> textfile3 把 textfile1 和 textfile2 的檔案內容加上行號(空白行不加)之后將內容附加到 textfile3 里。

        范例:

        把 textfile1 的檔案內容加上行號后輸入 textfile2 這個檔案里

        cat -n textfile1 > textfile2

        把 textfile1 和 textfile2 的檔案內容加上行號(空白行不加)之后將內容附加到 textfile3 里。

        cat -b textfile1 textfile2 >> textfile3

        cat /dev/null > /etc/test.txt 此為清空/etc/test.txt檔案內容

        cat 也可以用來制作 image file。例如要制作軟碟的 image file,將軟碟放好后打

        cat /dev/fd0 > OUTFILE

        相反的,如果想把 image file 寫到軟碟,請打

        cat IMG_FILE > /dev/fd0

        注:

        1. OUTFILE 指輸出的 image 檔名。

        2. IMG_FILE 指 image file。

        3. 若從 image file 寫回 device 時,device 容量需與相當。

        4. 通常用在制作開機磁片。

        
      看了“linux cat命令使用方法”還想看:

      1.Linux cat命令怎么使用

      2.Linux下如何使用cat命令

      3.cat命令應該怎么用

      4.Linux cat命令參數(shù)介紹

      2919641