Question: I have a directory with many subdirectories and files with suffixes in those subdirectories (e.g `FileA-suffixA FileB-SuffixB FileC-SuffixC FileD-SuffixA`, etc).

How can I recursively search for files with a certain suffix, and append a user-defined line of text to those files? I feel like this is a job for grep and sed, but I'm not sure how I would go about doing it. I'm fairly new to scripting, so please bear with me.

Answer: 
You can do it like 

```
find /where/to/search -type f -iname '*.SUFFIX' -exec echo "USER DEFINED STRING" >> \{\} \;

```

1. `find` searches in the suplied path
2. `-type f` finds only files
3. `-iname '*.SUFFIX'` find the .SUFFIXed names, case ignored
```
find ./ -name "*suffix" -exec bash -c 'echo "line_to_add" >> $1' -- {} \;

```

Basically you use find to get a list of the files. Then you use bash to echo append your line to that list.