Notes

Notes and References

View the Project on GitHub leabstrait/notes

Rename All Files Folders Specified Pattern

find . -depth -name '*_*' -execdir bash -c 'for f; do mv "$f" "${f//_/-}"; done' bash {} +

This command uses a for loop within the execdir option to iterate over the files and directories found by find and performs the renaming using the mv command.

Here’s a breakdown of the command: