The following command searching for folders named client within the pwd traversing to a max depth of 2. Then it executes npm i react-scripts@latest
in each found directory.
find . -maxdepth 2 -type d -name client -exec bash -c "cd '{}' && npm i react-scripts@latest" \;
Use the following command to print the directories before excuting a command with the following:
find . -maxdepth 2 -type d -name client -exec bash -c "cd '{}' && pwd" \;
The following command finds all files ending in .md
recursively. If @ 2021
is found, it is replaced with @ 2022
.
find . -type f -name "*.md" -exec sed -i'' -e 's/© 2021/© 2022/g' {} +
Finds all files in working directory and renames them.
find . -print0 | while read -d $'\0' file; do mv "$file" "${file/-es-LA}"; done