Skip to Content
gnux

-d, --delete

Delete characters in SET1, do not translate.

An option of trx.

Usage

trx -d STRING1 [STRING2]
trx --delete STRING1 [STRING2]

Details

ShortLongValueDefaultMeaning
-d--deletenonedelete characters in SET1, do not translate

Examples

Strip Windows carriage returns from a file

trx -d '\r' < dos.txt > unix.txt

Delete every digit

echox 'r2d2 c3po' | trx -d '[:digit:]'

Keep only the printable characters and newlines

trx -cd '[:print:]\n' < binary.log

Delete digits and squeeze the spaces left behind

echox 'a 1 2 b' | trx -ds '[:digit:]' ' '

Help in the terminal

gnux help trx --delete

On this page