自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Linux Cat命令及使用詳解

運維 系統(tǒng)運維
Red Hat Linux 有一個工具程序,它能夠幫助你保留簡短列表,將這些列表收集起來,甚至向你透漏一點你的系統(tǒng)信息。下面就是Linux Cat命令及使用詳解

Red Hat Linux 有一個工具程序,它能夠幫助你保留簡短列表,將這些列表收集起來,甚至向你透漏一點你的系統(tǒng)信息。這個工具叫做 Linux Cat,它是 concatenate(連鎖) 的簡寫,意思是合并文件。

Linux Cat使用方式:cat [-AbeEnstTuv] [--help] [--version] fileName
Linux Cat說明:把檔案串連接后傳到基本輸出(螢幕或加 > fileName 到另一個檔案)
參數(shù):
-n 或 --number 由 1 開始對所有輸出的行數(shù)編號
-b 或 --number-nonblank 和 -n 相似,只不過對于空白行不編號
-s 或 --squeeze-blank 當遇到有連續(xù)兩行以上的空白行,就代換為一行的空白行
-v 或 --show-nonprinting

Linux Cat范例:
cat -n textfile1 > textfile2 把 textfile1 的檔案內(nèi)容加上行號后輸入 textfile2 這個檔案里
cat -b textfile1 textfile2 >> textfile3 把 textfile1 和 textfile2 的檔案內(nèi)容加上行號(空白行不加)之后將內(nèi)容附加到 textfile3 里。
范例:
把 textfile1 的檔案內(nèi)容加上行號后輸入 textfile2 這個檔案里
cat -n textfile1 > textfile2
把 textfile1 和 textfile2 的檔案內(nèi)容加上行號(空白行不加)之后將內(nèi)容附加到 textfile3 里。
cat -b textfile1 textfile2 >> textfile3
cat /dev/null > /etc/test.txt 此為清空/etc/test.txt檔案內(nèi)容
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. 通常用在制作開機磁片。
cat主要有三大功能:go
1.一次顯示整個文件。$ cat filename ~,y6;e
2.從鍵盤創(chuàng)建一個文件。$ cat > filename 0#!7
只能創(chuàng)建新文件,不能編輯已有文件. :z)
3.將幾個文件合并為一個文件。 $cat file1 file2 > file"t?=\

Linux Cat參數(shù): p:DS
-n 或 --number 由 1 開始對所有輸出的行數(shù)編號 \r5
-b 或 --number-nonblank 和 -n 相似,只不過對于空白行不編號 |,3S
-s 或 --squeeze-blank 當遇到有連續(xù)兩行以上的空白行,就代換為一行的空白行 !s
-v 或 --show-nonprinting tds?O
范例: `@uq*Y
cat -n textfile1 > textfile2 把 textfile1 的檔案內(nèi)容加上行號后輸入 textfile2 這個檔案里 d
cat -b textfile1 textfile2 >> textfile3 把 textfile1 和 textfile2 的檔案內(nèi)容加上行號(空白行不加)之后將內(nèi)容附加到 textfile3 里。 ;L-#pj
范例: +Hu
把 textfile1 的檔案內(nèi)容加上行號后輸入 textfile2 這個檔案里 z]G=
cat -n textfile1 > textfile2 v"z&r3
把 textfile1 和 textfile2 的檔案內(nèi)容加上行號(空白行不加)之后將內(nèi)容附加到 textfile3 里。 RG.7n
cat -b textfile1 textfile2 >> textfile3 1M?1O
cat /dev/null > /etc/test.txt 此為清空/etc/test.txt檔案內(nèi)容 J2fx
cat 也可以用來制作 image file。例如要制作軟碟的 image file,將軟碟放好后打 {zQ
cat /dev/fd0 > OUTFILE %W~Ik.
相反的,如果想把 image file 寫到軟碟,請打 GK"d
cat IMG_FILE > /dev/fd0 e
注: ©Newboys -- Newboys綜合論壇  G
1. OUTFILE 指輸出的 image 檔名。 +cMcCt
2. IMG_FILE 指 image file。 Ew
3. 若從 image file 寫回 device 時,device 容量需與相當。 $

【編輯推薦】

  1. Linux Bash命令關于程序調(diào)試詳解 
  2. Linux Bash命令關于快捷鍵應用
  3. Linux Bash Shell系統(tǒng)的應用詳解
  4. Linux Bash具體安裝步驟及使用介紹
  5. Linux Bash命令查詢相關事件詳解
責任編輯:chenqingxiang 來源: 互聯(lián)網(wǎng)
相關推薦

2010-06-24 14:08:25

Linux Cat命令

2023-07-23 19:26:18

Linuxcat 命令

2010-06-24 14:49:00

Linux Cat詳解

2009-08-03 11:38:57

linux at命令詳linux at命令

2022-08-10 13:12:04

Linuxcat命令

2009-07-31 17:51:42

linux vi命令詳linux vi命令編輯器

2010-01-05 16:49:34

2010-06-24 13:57:57

Linux Cat命令

2010-01-15 19:37:36

Linux命令

2018-07-12 15:03:41

2009-08-03 09:20:18

find命令詳解find命令linux find命

2019-09-12 08:32:40

Linuxsed命令語法

2012-05-10 08:55:11

Linuxuniq

2010-06-24 14:12:20

Linux Cat命令

2010-06-01 16:46:38

Rsync 命令

2009-07-31 15:39:00

linux cd命令詳目錄切換技巧總結(jié)

2022-05-09 08:55:58

Linuxdiff命令

2010-06-24 14:38:48

Linux Cat命令

2010-06-22 13:23:18

Linux at命令詳

2009-08-04 08:32:06

Linux Find命Linux Find使用方法
點贊
收藏

51CTO技術棧公眾號