Forrest logo
back to the tr tool

tr:tldr:67ef4

tr: Translate the contents of a file to upper-case.
$ tr "[:lower:]" "[:upper:]" < ${filename}
try on your machine

This command is using the tr command utility to convert all lowercase characters to uppercase characters in a file specified by ${filename}.

Here is a breakdown of the command:

  • tr: This is the command utility used for character translation.
  • "[:lower:]": This is a character class that represents all lowercase letters in the current locale. It specifies the characters to be replaced.
  • "[:upper:]": This is another character class that represents all uppercase letters in the current locale. It specifies the characters to be used for replacement.
  • < ${filename}: This is input redirection, it sets the standard input stream for the tr command to the contents of the file specified by ${filename}.

So, the command takes the contents of the specified file, finds all lowercase letters, and replaces them with their corresponding uppercase letters. The output is then displayed on the command line.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tr tool