Good and Great use of 'tr' command

Apart from the regular tr command usage, it can be used for performing the following tasks too,

for converting a windows file to UNIX file use the following command,

tr -d ‘15’

if you need to concatenate the digits from a string, here is a way:

$ echo “Abc123d56E” | tr -cd ‘[[:digit:]]’
Output:
12356

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.