Section: tr Translation and Character Operations

Delete characters

bash
bash
tr -d '0-9' < file.txt
Explanation

Character deletion is useful for quick sanitization tasks.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing tr Translation and Character Operations
Convert lowercase to uppercase
Translate characters from lower to upper case.
OpenIn sheetbashsame section
Convert uppercase to lowercase
Translate text to lowercase.
OpenIn sheetbashsame section
Join lines into one line
Replace newlines with spaces.
OpenIn sheetbashsame section
Collapse repeated blank lines
Squeeze consecutive newline characters.
OpenIn sheetbashsame section
Extract character positions
Print characters 1 through 8 from each line.
OpenIn sheetbash1 tag match
Extract comma-delimited fields
Print the first and third fields from a CSV-like file.