|
|
|
|
|
by JoeAcchino
4771 days ago
|
|
find ~/my/docs/ -type f -name '*.txt' -exec sed -i.bak 's/inheritance/composition/g' {} +
This will search all files ending in `.txt` and will exec `sed 's/inheritance/composition/g'` on it. Sed modifies files in-place and saves a backup file with .bak extension (-i.bak) and is called the minimum necessary times (-exec +).My best advice to someone using the command line is to learn `find` + `xargs` or, even better, `find` + `parallel`. |
|