parsed.org

Tips by tag: tr

Lowercase Conversion by xinu on Jan 12, 2005 11:02 AM

If you find yourself needing to drop the case on the entire contents of a file, you can try this:

$ dd if=original of=filtered conv=lcase

-or-

$ tr '[A-Z]' '[a-z]' < original > filtered
charactersconversionddfilterlowercaseshelltr

You can use tr to remove non-printable characters from a data stream:

$ tr -cd '\11\12\40-\176' < $INPUT_FILE > $OUTPUT_FILE

(This tip taken from http://www.devdaily.com/unix/edu/un010011/.)

charactersconvertfilternon-printableshelltr
RSS