linux split 命令
功能說明:切割文件。
語 法:split [--help][--version][-<行數>][-b <字節>][-C <字節>][-l <行數>][要切割的文件][輸出文件名]
補充說明:split可將文件切成較小的文件,預設每1000行會切成一個小文件。
參 數:
-<行數>或-l<行數> 指定每多少行就要切成一個小文件。
-b<字節> 指定每多少字就要切成一個小文件。支持單位:m,k
-C<字節> 與-b參數類似,但切割時盡量維持每行的完整性。
--help 顯示幫助。
--version 顯示版本信息。
[輸出文件名] 設置切割后文件的前置文件名,split會自動在前置文件名后再加上編號。
使用例子:
split -b 100m filename
wc命令用來打印文件的文本行數、單詞數、字節數等(print the number of newlines, words, and bytes in files)。在Windows的Word中有個“字數統計”的工具,可以幫我們把選中范圍的字數、字符數統計出來。Linux下的wc命令可以實現這個 功能。使用vi打開文件的時候,底下的信息也會顯示行數和字節數。
常用參數
格式:wc -l <file>
打印指定文件的文本行數。(l=小寫L)
以下參數可組合使用。
參數:-c, --bytes[喝小酒的網摘]http://blog.hehehehehe.cn/a/17301.htm
打印字節數(print the byte counts)
參數:-m, --chars
打印字符數(print the character counts)
參數:-l, --lines
打印行數(print the newline counts)
參數:-L, --max-line-length
打印最長行的長度(print the length of the longest line)
參數:-w, --words
打印單詞數(print the word counts)
使用示例
示例一
[root@jfht ~]# wc /etc/passwd
46 66 2027 /etc/passwd
行數 單詞數 字節數 文件名
