May 2017
Beginner
552 pages
28h 47m
English
The tr command has an option -d to delete a set of characters that appear on stdin using the specified set of characters to be deleted, as follows:
$ cat file.txt | tr -d '[set1]' #Only set1 is used, not set2
Consider this example:
$ echo "Hello 123 world 456" | tr -d '0-9' Hello world # Removes the numbers from stdin and print