2

So I'm wanting to find out what the command line would look like to copy the text contained in a file, convert the whole thing to upper-case and paste that into a new file with a given name.

I'm very new to Linux so I've been running through a few lists of commands and existing questions but I couldn't find anything which answered this.

Thanks

5

The following command can do that

tr '[:lower:]' '[:upper:]' < input.txt > output.txt
  • Thanks, just to check my understanding... if i had File1 and I wanted to create a new file called File2 with the translated text in it I would write: tr '[:lower:]' '[:upper:]' < File1 > File2 ? – True_False_AX10M Apr 23 at 15:27
  • yes it will translate all the text in file1 and create a file file2 with upper case converted text of the file1. – aviral dobhal Apr 23 at 15:39
  • @True_False_AX10M Isn't your command identical to the answer, except for the filenames? – Barmar Apr 23 at 19:21
  • @Barmar yes it is. I just wanted to ensure I was understanding the formatting correctly and that the input output bits I would simply replace with the file names. – True_False_AX10M Apr 24 at 7:02
  • @aviral dobhal thanks for the help! – True_False_AX10M Apr 24 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.