Using tr and dos2unix
The tr tool is a real wizard. This simple command lets you replace strings in text files. Whether you are replacing letters or just removing whitespace, you will be amazed at tr‘s versatility.
The tr command replaces characters
in text files. The command
reads the standard input and
sends the results to standard output. But
of course, you can use the familiar operators
to redirect both streams. In fact, tr
really shines in combination with other
The tr command expects two strings as
arguments and replaces all the occurrences
of the first argument in a text
with the second argument. This may
sound complicated, but let’s look at a
simple example. The following command
replaces the “e“s in “Petronella”
Buy this article as PDF
Linux Magazine will include the best of both magazines.
Popular open source encryption tool is vulnerable to attack
New “Yakkety Yak” edition emphasizes cloud and servers
Google finally enters the phone hardware business.
Innovative system adds a hard drive and Ubuntu Core to the RPi for an IoT hub.
Linux is two weeks younger than we thought!
The Apache Software Foundation considers retiring OpenOffice
Adobe won’t kill the plugin in 2017
Linux Foundation's big event celebrates the 25th anniversary of Linux