I have a lot of text files (with .txt extension) in one directory in which I want to convert all letters to uppercase. How can I do this using the terminal?
I've tried:
sed -i 's/[A-Z]/[a-z]/g' *.txt
but without success...
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityThe right way using sed
should be done with the help of \U
switch:
sed -i 's/.*/\U&/' *.txt
See also: