2023年7月26日发(作者:)
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"`do sed -i '1iNumtPhonetDatetMessagetIdtGudge' ${fullpath}done备注:-type f
是指后边的查找⽂件类型为⽂件2、⽅法⼆find . -type f -name "*.txt" | xargs -I {} sed -i '1iNumtPhonetDatetMessagetIdtGudge' {}总结以上就是这篇⽂章的全部内容了,希望本⽂的内容对⼤家的学习或者⼯作具有⼀定的参考学习价值,谢谢⼤家对的⽀持。如果你想了解更多相关内容请查看下⾯相关链接
发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1690367438a339060.html
评论列表(0条)