写入查找命令中的所有文件匹配项>>

问题描述 投票:0回答:1

我想在linux shell中使用find command

将某些文本回显到所有文件中。我试过了find . -type f -name "file*.txt" -exec echo "some text" > - '{}' ';'但这不起作用。总有办法解决吗?

我想用linux shell中的find命令将一些文本回显到所有文件匹配中。我尝试了这个“查找。-type f -name“ file * .txt” -exec echo“ some text”>-'{}'';'但这是行不通的。是...

bash shell gnu-findutils
1个回答
0
投票

用GNU sed在最后一行(a)后面附加($)您的文本:

© www.soinside.com 2019 - 2024. All rights reserved.