Sed Tutorials


If you have written anything about sed - whether an introduction, how sed got you out of a real-life situation, or perhaps an advanced technique you've discovered - you may like have your work published here. Your contribution will be very welcome.

Intros

sed one-liners v4.4 (13kb)
The essential, official compendium of useful sed one-liners. Organised into sections by usage, such as file spacing, line numbering, selective line removal/deletion and optimisation. Updated 10 April 1998.
The sed FAQ v6 (95kb)
The official sed FAQ. Also an indispensable guide. This file is constantly under development. Also available compressed with Gnuzip (32kb) | PKZIP 2.04 (32kb).
Do it with sed (51kb)
By Carlos Jorge G.Duarte. A comprehensive and leisurely résumé. Contains many interesting examples, and a useful command summary.
SED - A Non-interactive Text Editor (32kb)
By Lee E. McMahon (1978). The definitive introduction, this well-known document used to be distributed with UNIX systems. It examines each of sed's functions in depth and includes useful examples.
Introduction to Unix's SED editor
By F. Curtis Michel, Rice University, Houston.

Advanced topics

Using sed to create a book index (12kb)
Eric Pement of Cornerstone magazine shows how he used sed and other utilities to massage an unsorted list of book references into an index.
Using lookup tables with s/// (9kb)
Part 1 of Greg Ubben's analysis of a complex sed script he wrote to sort, delimit and number an input file containing tabulated data. Lookup tables are a powerful technique for the serious seder's armoury.
A lookup-table counter (11kb)
Part 2 of Greg's script analysis looks at how he implemented a counter using lookup tables. This complex problem is described step by step from the basics, following through Greg's reasoning until we finally reach the solution.
Adding a list of decimals (2kb)
Greg explains how to add a list of decimal numbers using a simple analogue format.



Updated 10 Jun 1998