cat

英 [k?t]? ?美 [k?t]??

n.貓;貓科動(dòng)物;狠毒的女人;爵士樂(lè)愛(ài)好者

vt.把(錨)吊放在錨架上;〈俚〉尋歡,宿娼

第三人稱單數(shù): cats 復(fù)數(shù): cats 現(xiàn)在分詞: catting 過(guò)去式: catted 過(guò)去分詞: catted

Linux cat命令 語(yǔ)法

作用:cat 命令用于連接文件并打印到標(biāo)準(zhǔn)輸出設(shè)備上。

權(quán)限:所有使用者

語(yǔ)法:cat [-AbeEnstTuv] [--help] [--version] fileName

Linux cat命令 示例

把 textfile1 的文檔內(nèi)容加上行號(hào)后輸入 textfile2 這個(gè)文檔里:

cat -n textfile1 > textfile2

把 textfile1 和 textfile2 的文檔內(nèi)容加上行號(hào)(空白行不加)之后將內(nèi)容附加到 textfile3 文檔里:

cat -b textfile1 textfile2 >> textfile3

清空 /etc/test.txt 文檔內(nèi)容:

cat /dev/null > /etc/test.txt

cat 也可以用來(lái)制作鏡像文件。例如要制作軟盤的鏡像文件,將軟盤放好后輸入:

cat /dev/fd0 > OUTFILE

相反的,如果想把 image file 寫到軟盤,輸入:

cat IMG_FILE > /dev/fd0