Linux trThe command 'tr' stands for 'translate'. It is used to translate, like from lowercase to uppercase and vice versa or new lines into spaces. Syntax: Change CaseThe 'tr' command can change case. Syntax: Example: Look at the above snapshot, all p,r,c,u are converted into upprecase P,R,C,U. Remove New LinesTo write all the lines into a single line we have to translate all new lines into spaces. Syntax: Example: tr Options
Syntax: Example: Look at the above snapshot, command "cat jtp.txt | tr -s 'l'" has squeezed all the letters 'l' into one and command "cat spaces.txt | tr -s ' '" has squeezed all the spaces into single space. Example: Look at the above snapshot, all the letters are encrypted according to the command. But letter 'A' and 'M' are not encrypted as they are in upper case. Syntax: Example: Look at the above snapshot, all the 'o' letters are deleted from the file 'exm.txt'. Next TopicLinux Uniq |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India