These one-liners, just like the Awk one-liners, are compiled by Eric Pement.
You may download them here: sed one-liners (link to .txt file).
Most people are only familiar with one particular command of sed, namely the "s" (substitute) comand. s/comand/command/. That is unsatisfactory. Sed has at least 20 different commands for you. You can even write tetris in it (not to mention that it's Turing complete).
My sed learning process was actually identical to Awk learning process. First I went through Bruce Barnett's sed tutorial; then I created a sed cheat sheet; and finally went through sed one-liners. I could not figure one of the one-liners in the file, so I ended up asking for help in comp.unix.shell.
Eric's sed one-liners are divided into several sections:
- 1. File spacing (explained in this part).
- 2. Numbering (explained in this part).
- 3. Text conversion and substitution (explained in this part).
- 4. Selective printing of certain lines (explained in part two).
- 5. Selective deletion of certain lines (explained in part three).
- 6. Special applications (explained in part three).
- 7. Release of Sed One-Liners Explained e-book. "
- Top Ten One-Liners from CommandLineFu Explained
- My Job Interview at Google
- MIT's Introduction to Algorithms, Lectures 1 and 2: Analysis of Algorithms
- Famous Awk One-Liners Explained, Part I: File Spacing, Numbering and Calculations
- The Definitive Guide to Bash Command Line History
'via Blog this'
No comments:
Post a Comment