亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

shell命令實(shí)現(xiàn)當(dāng)前目錄下多個(gè)文件合并為一個(gè)文件的方法

 更新時(shí)間:2019年02月26日 15:24:25   作者:sxf_0123  
今天小編就為大家分享一篇關(guān)于shell命令實(shí)現(xiàn)當(dāng)前目錄下多個(gè)文件合并為一個(gè)文件的方法,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧

當(dāng)前目錄下多個(gè)文件合并為一個(gè)文件

1、將多個(gè)文件合并為一個(gè)文件沒有添加換行符

find ./ -name "iptv_authenticate_201801*" | xargs cat > iptv_authenticate.txt

2、設(shè)置換行符^J

find ./ -name "iptv_authenticate_201801*" | xargs sed 'a\^J' > iptv_authenticate.txt

3、默認(rèn)換行符

find ./ -name "iptv_authenticate_201801*" | xargs sed 'a\' > iptv_authenticate.txt

find ./ -name "iptv_liveswitch_201801*" | xargs sed 'a\' > iptv_liveswitch.txt

find ./ -name "iptv_qualified_201801*" | xargs sed 'a\' > iptv_qualified.txt

find ./ -name "iptv_vodload_201801*" | xargs sed 'a\' > iptv_vodload.txt

當(dāng)前目錄下所有后綴為txt文件中追加一行數(shù)據(jù)作為文件內(nèi)容的第一行內(nèi)容

1、方法一

for fullpath in `find . -type f -name "*.txt"`
do
  sed -i '1i\Num\tPhone\tDate\tMessage\tId\tGudge' ${fullpath}
done

備注:

-type  f 是指后邊的查找文件類型為文件

2、方法二

find . -type f -name "*.txt" | xargs -I {} sed -i '1i\Num\tPhone\tDate\tMessage\tId\tGudge' {}

總結(jié)

以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對腳本之家的支持。如果你想了解更多相關(guān)內(nèi)容請查看下面相關(guān)鏈接

相關(guān)文章

最新評論