memius
memius

Reputation: 4125

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.

Upvotes: 3

Views: 3607

Answers (2)

convmv is used to convert filenames between encodings. I'm sure it can solve your problem, even if it might not be exactly what you asked for.

Upvotes: 0

int
int

Reputation: 224

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

find / -type f -exec rename 'â' 'a' {} \;

Upvotes: 1

Related Questions