Recursively rename files - oneliner preferably
- by zetah
I found this answer how do i... but it simply doesn't work - it did not rename any file for unknown to me reason
Before I started to search around I thought that it should be easy task even for novice penguin, but it doesn't seem so for me.
For example, I simply can't tell ls to list all *.txt in all subfolders, which was surprise to me (without grep or similar).
Then I found find and find . -name name_1.txt lists files fine, but
for f in $(find . -name name_1.txt) ; do echo "$f" ; done
splits whole file paths with space as separator, so it's unusable to pass that output to some command like mv or rename
I want to ask whats wrong with above command and if possible some nifty oneliner so I can recursively rename name_1.txt to name_2.txt