music |
| | OSdata.com |
sed
summary
This subchapter looks at sed, a Unix (and Linux) command.
sed
This subchapter looks at sed, a Unix (and Linux) command.
sed is a command line editor.
fixing end of line
Windows and DOS end every line with the old carriage return and line feed combination (\r\n). You cna use sed to convert Windows/DOS file format to UNIX file format:
$ sed 's/.$//' filename
adding line numbers
You can use sed to add line numbers to all of the non-empty lines in a file:
$ sed '/./=' filename | sed 'N; s/\n/ /'
other
On November 8, 2010, Ramesh Natarajan named this the number five (5) most frequently used Unix/Linux command at this web page 50 Most Frequently Used UNIX / Linux Commands (With Examples).
In June 2009, Ken Milberg named this command as one of the Top 50 universal UNIX commands at this web page Top 50 Universal INIX commands. Note that this web page requires agreeing to be spammed before you can read it.
sed is for modifying the contents of files using editing commands, including regular expressions. The GNU Sed has many more capabilities than the traditional or POSIX versions of Sed.#148; Jonathan Leffler