grep --files-with-matches '>' .
> in the current directory (
.) and print only the filenames of matching files (
grep will not return anything if you give it a directory (
.) but forget to enable "recursive" mode. The correct command would be
grep --files-with-matches --recursive '>' .
grep -Rl '>' .
Sort results, and remove duplicates.
| xargs perl -pi~ -e 's/9Kp/9K /' /home/user/DATAFILE.DAT
Run the given command (
perl ...) with every word1 from stdin passed as additional arguments.
Every file from the
grep results, and also the
/home/user/DATAFILE.DAT file, are updated by replacing the text "
9Kp" with "
9K ". The old files are backed up with a trailing tilde.
1 Note: word, not line. This means that a filename with spaces will be treated as several names.
xargs -d'\n' would be better, although not perfect.