使用"呼应追加>>文件"递归 [英] Using " echo append >> file" recursively

查看:124
本文介绍了使用"呼应追加>>文件"递归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

欲行追加到文件夹中的每个文件的结尾。我知道可以用

 回声apendthis>>文件

的字符串追加到一个文件中。但是,什么是递归地做到这一点的最好方法是什么?


解决方案

 找到。型的F -exec的bash -c回声这个追加>> {}'\\;

I want to append a line to the end of every file in a folder. I know can use

echo apendthis >> file

to append the string to a single file. But what is the best way to do this recursively?

解决方案

find . -type f -exec bash -c 'echo "append this" >> "{}"' \;

这篇关于使用"呼应追加>>文件"递归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆