Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using " echo append >> file" recursively

Tags:

bash

append

echo

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?

like image 544
Jesse Avatar asked Mar 17 '26 17:03

Jesse


1 Answers

find . -type f -exec bash -c 'echo "append this" >> "{}"' \;
like image 112
uselpa Avatar answered Mar 19 '26 09:03

uselpa