linux學習之shell腳本 ------- 文本過濾

  [本文是自己學習所做筆記,歡迎轉載,但請註明出處:http://blog.csdn.net/jesson20121020]

  今天來看一下shell關於文字過濾的知識,其實最主要的就是正則表達式以及關於文本的一常見的命令。

正則表達式:

  一種用來描述文本模式的特殊語法。

  由普通字符(例如字符az)以及特殊字符(稱爲元字符,如/、*、?等)組成。

基本元字符集及其含義:

字符

含義

^

只匹配行首

$

只匹配行尾

*

匹配0個或多個單字符

[ ]

只匹配[]內字符,可以是一個單字符,也可以是字符序列,可以使用-表示[]內字符序列範圍,如[1-5]代表[12345]

\

只用來屏蔽一個元字符的特殊含義

.

只匹配任意單個字符

pattern\{n\}

只用來匹配前面pattern出現次數,n爲次數

pattern\{n,\}

含義同上,但次數最少爲n

Pattern\{n,m\}

含義同上,但pattern出現次數在nm 之間

   部分元字符具體用法:

  \屏蔽一個特殊字符

   這裏的特殊字符有’’||*+

   \*\.pas

    - 正則表達式中匹配以*.pas結尾的所有字符或文件

  []匹配一個範圍或集合

   - 逗號將括弧內要匹配的不同字符串分開

   - 用 表示一個字符串範圍,表明字符串範圍從 左邊字符開始,到 右邊字符結束。

  例子:

[0123456789]或[0-9]:假定要匹配任意一個數字。

[a-z]:匹配任意小寫字母

[A-Z a-z]:匹配任意大小寫字母

[A-Z a-z0-9]:匹配任意字母或數字

[S,s]:匹配大小寫s

  \{\}匹配模式結果出現的次數

  例子:

A\{2\}B:A出現2次,即AAB

A\{4,\}B:A最少出現4次,AAAAB,AAAAAB,....

A\{\2,4}B:A出現次數2-4次,即AAB,AAAB,AAAAB


一些關於文本處理的命令:

  find命令

     -命令形式:

Find pathname -option [-print -exec -ok]

- pathname: find命令所查找的目錄

- -print: find命令將匹配的文件輸出到標準輸出

- -exec: find命令對匹配的文件執行該參數所給出的shell命令,相應命令的形式爲 ‘command’ {} \; ,注意{}和\;之間的空格

- -ok 和 -exec的作用相同,只不過以一種更爲安全的模式來執行該參數所給出的shell命令,在執行每一個命令之前,都會給出提示,讓用戶來確定是否執行。

- -name: 按照文件名來查找

- -perm: 按照文件權限來查找

- -user: 按照文件所有者來查找文件

- -group: 按照文件所屬組來查找文件

- -mtime -n +n: 按照文件的更改時間來查找文件, -n 表示文件更改時間距現在n天以內,+n表示文件更改時間距現在n天以前。

- -size n[c]: 查找文件長度爲n塊的文件,帶有c時表示文件長度以字節計

- -nogroup: 查找無有效所屬組的文件,即該文件所屬的組在/etc/groups中不存在

- -nouser: 查找無有效所有者的文件

- -newer file1 !file2:查找更改時間比文件file1新,但是比文件file2舊的文件

- -type:查找某一類型的文件,如:

b: 塊設備文件

d: 目錄

c: 字符設備文件

p: 管道文件

l: 符號鏈接文件

f: 普通文件

- -xargs

在使用find命令時的-exec選項處理匹配到的文件時,find命令將所有匹配到文件一起傳遞給exec。不幸的是,有些系統對能夠傳遞給exec的命令的長度有限制,這樣在find命令運行幾分鐘後,就會出現溢出的錯誤。錯誤信息通常是”參數列太長”或”參數列溢出” 。這就是xargs命令的用處所在,特別是與find命令一起使用。-exec會發起多個進程,但-xargs不會發起多個進程,只有一個。

- -depth選項

使用find命令時,可以希望先匹配所有文件,再在子目錄中查找
  關於find命令的選項有很多,這裏只列出了常用的選項,更多的參數,可以通過man find來查看。

  部分選項例子:

  -newer選項

jesson@jesson-HP:~/develop/workspace/shell_workspace$ find -newer "who.out" ! -newer "term.txt"
./ls.out
./term.txt
./path.out
./nullfile.txt
./ls_sort.out
  -size 選項
jesson@jesson-HP:~/develop/workspace/shell_workspace$ find -size +300c 
./parm.sh
jesson@jesson-HP:~/develop/workspace/shell_workspace$ ls -al parm.sh 
-rwxrw-r-- 1 jesson jesson 637  1月 17 17:07 parm.sh
  -depth選項

  使用find命令時,可以希望先匹配所有文件,再在子目錄中查找

 find / -name “CON.FILE” -depth -print
  - execok來執行shell命令
find . -type f -exec ls -l {} \;
find. -name “*.log” -mtime +5 -ok rm {} \;
  -xargs
find -type f -print | xargs file
Find ./ -perm -7 -print | xargs chmod o-w

  grep命令

   對文本文件進行模式查找

   有三種變形:

   - grep:標準grep命令

   - egrep:擴展的grep命令,支持基本及擴展的正則表達式

   - fgrep:快速grep命令

   一般格式:

   - grep [option] 基本正則表達式 [文件]

   - 字符串參數最好採用雙引號括,一是以防被誤解爲shell命令,二是可以用來查找多個單詞組成的字符串

   命令選項:

   - -c:只輸出匹配行的計數

   - -i:不區分大小寫(只適用於單字符)

   - -h: 查詢多文件時不顯示文件名

   - -H: 顯示文件名

   - -l: 查詢多文件時只輸出包含匹配字符的文件

   - -n: 顯示匹配行及行號

   - -s: 不顯示不存在無匹配文本的錯誤信息

   - -v: 顯示不包含匹配文本的所有行

   例子:

grep “jesson” *.txt 

- 在所有.txt文件中查找jesson

grep “^[^201]” myfile

- 在myfile中查找不是以2,0,1開頭的行

grep “^$” myfile

- 在myfile中查找空行

grep “^[^dlp]” myfile

- 在myfile中查找不是以d l p開頭的行


  grep命令類名

等價的正則表達式

[[:upper:]]

[A-Z]

[[:alnum:]]

[0-9a-zA-Z]

[[:lower:]]

[a-z]

[[:space:]]

空格或tab

[[:digit:]]

[0-9]

[[:alpha::]]

[a-zA-Z]

 

  awk介紹

   awk可以從文件字符串中基於指定規則瀏覽和抽取信息,是一種自解釋的編程語言。

   調用awk 三種方式:

   - 命令行方式:

     awk [-F field-spearator] ‘command’ input-files

   - awk腳本

     所有awk命令插入一個文件,並使awk程序可執行,然後用awk命令解釋器作爲腳本的首行,以便通過鍵入腳本名稱來調用它。

   - awk命令插入一個單獨的文件

     awk -f awk-scipt-file input-files

   awk腳本是由各種模式和動作組成。

   模式和動作:

   -模式部分決定動作語句何時觸發及觸發事件(BEGIN,END)

   -動作對數據進行處理,放在大括號{}內指明。如print

   分隔符、域和記錄

   -awk執行時,其瀏覽域標記爲$1,$2,....,$n.。這種方法稱爲域標識,$0爲所有域。

   -注意執行時不要混淆符號$shell提示符$

   awk 中特殊元字符:+,?

   匹配操作符:~,!~

    cat myfile | awk '$0 ~/218.79.131.96/'

     -打印出myfile中以匹配218.79.131.96的行

    awk '$0 !~ /218.79.131.96/' myfile

     -打印出myfile中不匹配218.79.131.96的行

    awk '{if($1 == "218.79.131.96") print $0}' myfile

     -打印出myfile中第一列等於218.79.131.96的行。

  例子:

   awk '{print $0}' myfile

    -打印出myfile中所有域,即打印出文件中的所有文件。

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk '{print $0}' lsout.txt 
總用量 60
-rw-rw-r-- 1 jesson jesson   0  1月 22 23:43 2
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh
-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh
-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort
-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh
-rw-rw-r-- 1 jesson jesson   0  1月 31 10:08 lsout.txt
-rw-rw-r-- 1 jesson jesson  14  1月 22 23:07 name.txt
-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
   awk '{print $9 "\t" $3}' myfile

    -打印出myfile中第9列和第三列,並以tab分隔.

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk '{print $9 "\t" $3}' lsout.txt 
break_test.sh	jesson
case_test.sh	jesson
continue_test.sh	jesson
file_desc.sh	jesson
for_test1.sh	jesson
for_test2.sh	jesson
for_test3.sh	jesson
helloworld.sh	jesson
homefile.txt	jesson
homefile.txt.sort	jesson
if_test.sh	jesson
lsout.txt	jesson
name.txt	jesson
until_test.sh	jesson
while_test1.sh	jesson
while_test2.sh	jesson
   另外,可以通過"-F 分隔符"來指定分隔。

   awk BEGIN END用法:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ awk 'BEGIN {print "Current directory file and its owner"} {print $3 ": " $9} END {print "end-of-report"}' lsout.txt 
Current directory file and its owner
jesson: break_test.sh
jesson: case_test.sh
jesson: continue_test.sh
jesson: file_desc.sh
jesson: for_test1.sh
jesson: for_test2.sh
jesson: for_test3.sh
jesson: helloworld.sh
jesson: homefile.txt
jesson: homefile.txt.sort
jesson: if_test.sh
jesson: lsout.txt
jesson: name.txt
jesson: until_test.sh
jesson: while_test1.sh
jesson: while_test2.sh
end-of-report

  sed介紹

   sed不與初始化文件打交道,它操作的只是一個拷貝,然後所有的改變如果沒有重定向到一個文件,就將輸出到屏幕。sed是一種重要的文本過濾工具,使用一行命令或者使用管道與grep或awk相結合使用。另外,它也是非交互性文本流編輯。

   調用sed方式:

    -使用sed命令行格式:

      sed [選項] sed命令 輸入文件

    -使用sed腳本文件

      sed [選項] -f sed腳本文件 輸入文件

    -sed 腳本文件 [選項] 輸入文件

    不管是使用shell命令行方式還是腳本文件方式,如果沒有指定輸入文件,則sed從標準輸入中接受輸入,一般是鍵盤。

   sed命令選項:

    -n 不打印沒有匹配到的

    -c 下一命令是編輯命令

    -f 正在調用sed腳本文件

   sed在文件中查詢文體的方式

    -使用行號,可以是一個簡單的數字,也可以是一個行號範圍。

    -使用正則表達式

x

x爲一行號

x,y

表示行號範圍從x到y

/pattern/

查詢包含模式的行

/pattern/pattern/

查詢包含兩個模式的行

pattern/,x

查詢在給定行號上查詢包含模式的行

x,/pattern/

通過行號和模式查詢匹配和行

x,y!

查詢不包含指定行號x 和y的行

    基本sed編輯命令:

p

打印匹配行

=

顯示文件行號

a\

 在定位行號附加新文本信息

i\

 在定位行號後插入新文本信息

d

刪除定們行

c\

用新文本替換定位文本

s

使用替換模式替換相應模式

r

從另一文件中讀文本

w

寫文本到一個文件

q

第一個模式匹配完成後退出或立即退出

l

顯示與八進制ASCII代碼等價的控制字符

{}

在定位行執行的命令組

n

從另一個文件中讀文本下一行,並附加在下一行

g

將模式2粘貼到/pattern n/

y

傳送字符

   部分用法例子: 
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '2p' lsout.txt 
總用量 60
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh
-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh
-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort
-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh
-rw-rw-r-- 1 jesson jesson   0  1月 31 10:35 lsout.txt
-rw-rw-r-- 1 jesson jesson  14  1月 22 23:07 name.txt
-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '2p' lsout.txt  
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '1,4p' lsout.txt 
總用量 60
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
 jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '/while/p' lsout.txt 
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '2,/for/p' lsout.txt 
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n '/name/a \hello sed!' lsout.txt 
hello sed!
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat name.txt 
jesson
cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '/jesson/c\jesson20121020' name.txt 
jesson20121020
cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '/jesson/i\jesson20121020' name.txt 
jesson20121020
jesson
cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed '1d' name.txt 
cherryjesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat name.txt 
jesson
jesson
merry
cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed 's/jesson/jesson20121020/g' name.txt 
jesson20121020
jesson20121020
merry
cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n 's/jesson/& hello/p' name.txt 
jesson hello
jesson hello
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sed -n 's/jesson/hello &/p' name.txt 
hello jesson
hello jesson

   有關sed的更多用法,可以查看幫助文檔,man sed 或 info sed

合併與分隔

  sort命令

   用法:

    sort [options] files

    -許多不同的域按不同的列順序分類。

    --c測試文件是否已經分類

    --m合併兩個分類文件

    --u刪除所有重複行

    --o存儲sort結果的輸出文件名

    --t 域分隔符;用非空格或tab鍵分隔域

    -+n n爲域號,使用此域號開始分類

    -n指定分類是域上的數字分類項

    --r 比較求決逆。

   例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -c name.txt 
sort:name.txt:4:無序: cherry
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat lsout.txt 
總用量 60
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh
-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh
-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort
-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh
-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt
-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt
-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt
-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -u lsout.txt 
-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt
-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh
-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh
總用量 60
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ sort -r lsout.txt 
總用量 60
-rwxrwxr-x 1 jesson jesson  78  1月 23 23:05 for_test2.sh
-rwxrwxr-x 1 jesson jesson  73  1月 23 23:06 for_test3.sh
-rwxrwxr-x 1 jesson jesson  72  1月 23 23:49 while_test2.sh
-rwxrwxr-x 1 jesson jesson  67  1月 23 23:04 for_test1.sh
-rwxrwxr-x 1 jesson jesson  46  1月 22 23:03 helloworld.sh
-rwxrwxr-x 1 jesson jesson 459  1月 24 00:07 continue_test.sh
-rwxrwxr-x 1 jesson jesson 263  1月 24 00:05 break_test.sh
-rwxrwxr-x 1 jesson jesson 218  1月 23 00:07 case_test.sh
-rwxrwxr-x 1 jesson jesson 217  1月 22 23:42 if_test.sh
-rwxrwxr-x 1 jesson jesson 132  1月 23 23:47 while_test1.sh
-rwxrwxr-x 1 jesson jesson 112  1月 23 23:32 until_test.sh
-rwxrwxr-x 1 jesson jesson 104  1月 22 23:07 file_desc.sh
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:31 homefile.txt.sort
-rw-rw-r-- 1 jesson jesson 573  1月 16 00:30 homefile.txt
-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt
-rw-rw-r-- 1 jesson jesson  27  2月  1 18:00 name.txt
-rw-rw-r-- 1 jesson jesson   0  2月  1 18:03 lsout.txt

  uniq命令

   格式:

     uniq [option] files

     -從一個文本文件中去除或禁止重複行

     --u只顯示不重複行 

     --d只顯示有重複的行,每種重複行只顯示其中一行

     --c打印每一重複行出現次數

     --f n n爲數字,前n個域被忽略。

   例子:   

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -c name.txt 
      2 jesson
      1 merry
      1 cherry
 jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -d name.txt 
jesson
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ uniq -u name.txt 
merry
cherry

   join命令

    格式:

     join [option] file1 file2

     -用來將來自兩個分類文本文件的行連接在一起。

     --an, n爲一個數字,用於連接時從文件n中顯示不匹配行。

     --o n.m 連接域,n爲文件號,m爲域號

     --j n m n爲文件號,m爲域號。使用其他域作連接域。

     --t 域分隔符,用來設置非窗或tab鍵的域分隔符。

  split命令

    格式:

     split -output_file-size input-filename output-filename

     --b n  每個分割文件的大小n

     --C n  每個分割文件一行最多n字節

     --l n 每個分割文件的行數

     --n 同-l n

    例子:

jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ cat lsout.txt | wc -l
18
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ split -6 lsout.txt split
 jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$  ls -l split* | wc -l
3
jesson@jesson-K43SV:~/develop/worksapce/shell_workspace$ ls -l split*
-rw-rw-r-- 1 jesson jesson 313  2月  1 20:00 splitaa
-rw-rw-r-- 1 jesson jesson 358  2月  1 20:00 splitab
-rw-rw-r-- 1 jesson jesson 348  2月  1 20:00 splitac
  

   另外,關於合併和分割的命令,其實還有cut和paste,這些命令用法都很相似,可以查看幫助文檔查看其詳細的用法。

     





   







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章