bash - Rename all files in subfolders - replace string in filename -


i want rename files in folder , subfolders.

i need change string hex20 string hex8. filenames have other numbers, cannot change 20 8.

an example of full path is:

\\frds01006\z188018\fem\linear\hex20\3hex20\3hex20.bof 

i same replacement folder names.

how this:

find . -name "*hex20*" -exec rename hex20 hex8 '{}' + 

this search recursively through current directory , subdirectories match hex20. (the flag -type f omitted because asker wants change names of directories in addition files.) build long rename command , call it. type of construction may simpler building series of commands sed , executing them one-by-one.


Comments