Emacs, scripting and anything text oriented.

Using sed

Kaushal Modi

sed stands for stream editor.

This is the most common way of my sed usage:

echo [SOMETHING] | sed 's/old/NEW/g'

Based on that, I have this tcsh alias1 to get timestamps that I use to append to quick tar backups.

alias gettimestamp 'date | tr " :" "__" | sed '"'"'s/_[0-9]*_EDT.*//g'"'"''

Learn about sed from [here][s1].


  1. Note how single quotes are escaped inside single-quoted alias definitions in tcsh. [s1]: http://www.grymoire.com/Unix/Sed.html ↩︎