中文字幕亚洲第一精品|精品国产免费一区二区|久久婷婷五月六月综合版|中文字幕熟妇久久久人妻|久久综合精品国产一区无码|国产成人精品永久免费视频|午夜亚洲国产精品理论片a级|久久精品一区二区三区无码护土

 訪問(wèn)手機(jī)版  

Linux常用命令|Linux培訓(xùn)學(xué)習(xí)|考試認(rèn)證|工資待遇與招聘,認(rèn)準(zhǔn)超級(jí)網(wǎng)工!

招聘|合作 登陸|注冊(cè)

網(wǎng)絡(luò)工程師培訓(xùn)

當(dāng)前位置:網(wǎng)絡(luò)工程師 > 技術(shù)課程 > linux > 熱點(diǎn)關(guān)注 > linux常用命令

Linux常用基本命令(split )

時(shí)間:2019-11-06

常用linux命令_linux常用命令_linux命令中的head命令

作用:切割文件

格式:

split [option] [input] [prefix]

linux命令中的head命令_常用linux命令_linux常用命令

-l 指定分割后文件的最大行數(shù)

ghostwu@dev:~/linux/split$ cat -n ghostwu.txt 
     1    What is Memcached?
     2    Free & open source,
     3    high-performance,
     4    distributed memory object caching system,
     5    generic in nature
     6    but intended for use in speeding up dynamic web applications by alleviating database load.
     7    Memcached is an in-memory key-value store for small chunks of arbitrary data
     8    (strings, objects) from results of database calls
     9    API calls, or page rendering.
    10    Memcached is simple yet powerful. 
    11    Its simple design promotes quick deployment,
    12    ease of development
    13    and solves many problems facing large data caches.
    14    Its API is available for most popular languages.

把ghostwu.txt這個(gè)文件linux常用命令,每個(gè)文件最大6行l(wèi)inux常用命令,前綴為ghostwu_

常用linux命令_linux常用命令_linux命令中的head命令

ghostwu@dev:~/linux/split$ ls
ghostwu.txt
ghostwu@dev:~/linux/split$ wc -l ghostwu.txt
14 ghostwu.txt
ghostwu@dev:~/linux/split$ split -l 6 ghostwu.txt ghostwu_
ghostwu@dev:~/linux/split$ ls
ghostwu_aa  ghostwu_ab  ghostwu_ac  ghostwu.txt
ghostwu@dev:~/linux/split$ wc -l ghostwu_ab
6 ghostwu_ab
ghostwu@dev:~/linux/split$ wc -l ghostwu_aa
6 ghostwu_aa
ghostwu@dev:~/linux/split$ wc -l ghostwu_ac
2 ghostwu_ac

用通配符更簡(jiǎn)單

ghostwu@dev:~/linux/split$ ls
ghostwu_aa  ghostwu_ab  ghostwu_ac  ghostwu.txt
ghostwu@dev:~/linux/split$ wc -l ghostwu_*
  6 ghostwu_aa
  6 ghostwu_ab
  2 ghostwu_ac
 14 total

linux命令中的head命令_常用linux命令_linux常用命令

-a : 指定切割文件的后綴長(zhǎng)度

ghostwu@dev:~/linux/split$ split -l 5 -a 3 ghostwu.txt ghostwu_
ghostwu@dev:~/linux/split$ ls
ghostwu_aaa  ghostwu_aab  ghostwu_aac  ghostwu.txt
ghostwu@dev:~/linux/split$ wc -l ghostwu_*
  5 ghostwu_aaa
  5 ghostwu_aab
  4 ghostwu_aac
 14 total
 上一個(gè)教程:Linux終端常用命令大全