Linux tr command Part 1

Video is ready, Click Here to View ×

Part 1 shows you how the tr command on Ubuntu Linux can be used to translate one set of characters to another set of characters.
Make sure to also check out the other parts:
Part 2 shows you how to use the tr command to delete characters using the option –delete.
Part 3 shows you how to get rid of repeating characters by using the option –squeeze-repeats.
Part 4 shows you how translate all characters except for a certain set of characters using the option –complement.
Also, check out…


  1. how can i get 2 spaces to be 1 space and 1 space to go so i get only 1 space at end of it all?

    for example i need

    T H I S I S B I N A R Y b l a b l a b l a b l a b l a b l a 1 2 3 4 5 6 7 8 9 0

    to become

    THIS IS BINARY blablablablablabla 1234567890

    i'v also tried just removing a space and replacing it with nothing but i get an error!

  2. so it doesn't translate one letter for [a-z] regular expression but all the lower case letters? it's a little confusing cz usually in scripting it would've required [a-z]* or + or whatever…

Leave a Reply

Your email address will not be published.