Using Tr To Remove Certain Characters And Keep Oth
tr -dc ‘[:alnum:]\n\r’ | tr ‘[:upper:]’ ‘[:lower:]’
trdeletes special characters.dis delete.cis complement (invert the character set).dcis therefore, delete all characters, except those specified.- Can preserve certain characters, such as
\nand\rabove. - The second line translates uppercase characters to lowercase.