2023年7月26日发(作者:)
shell换⾏合并多个⽂件_shell命令实现当前⽬录下多个⽂件合并为⼀个⽂件的⽅法...shell换⾏合并多个⽂件_shell命令实现当前⽬录下多个⽂件合并为⼀个⽂件的⽅法...阿伯刺的俄佛歌 2021-01-30 08:31:34 9 收藏⽂章标签: shell换⾏合并多个⽂件版权当前⽬录下多个⽂件合并为⼀个⽂件1、将多个⽂件合并为⼀个⽂件没有添加换⾏符find ./ -name "iptv_authenticate_201801*" | xargs cat > iptv_2、设置换⾏符^Jfind ./ -name "iptv_authenticate_201801*" | xargs sed 'a^J' > iptv_3、默认换⾏符find ./ -name "iptv_authenticate_201801*" | xargs sed 'a' > iptv_d ./ -name "iptv_liveswitch_201801*" | xargs sed 'a' > iptv_d ./ -name "iptv_qualified_201801*" | xargs sed 'a' > iptv_d ./ -name "iptv_vodload_201801*" | xargs sed 'a' > iptv_当前⽬录下所有后缀为txt⽂件中追加⼀⾏数据作为⽂件内容的第⼀⾏内容1、⽅法⼀for fullpath in `find . -type f -name "*.txt"`dosed -i '1iNumtPhonetDatetMessagetIdtGudge' ${fullpath}done备注:-type f是指后边的查找⽂件类型为⽂件2、⽅法⼆find . -type f -name "*.txt" | xargs -I {} sed -i '1iNumtPhonetDatetMessagetIdtGudge' {}总结
发布者:admin,转转请注明出处:http://www.yc00.com/news/1690363418a338203.html
评论列表(0条)