Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change a single letter in filenames all over the file system?

i have hundreds of files with special characters ('æ', 'ø' and 'å') in their filenames.

i cannot copy these to my external mntfs disk without renaming.

the files are in dozens of different folders. there are thousands of other files without these letters in there as well.

i'd like to replace the special characters with their placeholders ('ae', 'oe' and 'aa'), while keeping the rest of the filename intact.

i'm on ubuntu. i'm thinking of using grep, sed and tr, but i don't know exactly how.

like image 424
memius Avatar asked Dec 10 '25 01:12

memius


1 Answers

You can use rename command from util-linux package. For example,

find / -type f -exec rename 'â' 'a' {} \;
like image 194
int Avatar answered Dec 13 '25 09:12

int



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!