Dean
Dean

Reputation: 65

How to rename many files (found with glob) from lower to the upper case without changing the extension?

I used:

rename 's/a-z/A-Z' *.txt

However, this command changes the register of the file extension as well.

Upvotes: 2

Views: 51

Answers (1)

Avinash Raj
Avinash Raj

Reputation: 174706

Think you mean this,

rename 's/([a-z])(?=.*?\.txt$)/\U$1/g' *.txt

Upvotes: 2

Related Questions