[Linux] For deleting tab characters and spaces, tr command with -d option is simple and recommended
In Linux, deleting tab characters and spaces can be easily done by adding the -d option to the tr command.
# Delete tab characters
tr -d '\ '
# Delete half-width spaces
tr -d ' '
The tr command can also be used on Mac, so it’s recommended for Mac users too.
Here’s how to use the tr command:
tr Bulk character conversionSyntax tr [Option] set1 [set2]
Options -c Replace set1 with characters not included in set1 -d Delete characters in set1 -s Replace consecutive identical characters with a single character -t Adjust set1 to the same string length as set2 set1 Specify a set of characters set2 Specify a set of characters
That’s all from the Gemba.