68 / 102
There's more than one way to do it
UNIX command | sed equivalent |
---|---|
cat |
sed ':' |
tac |
sed '1!G;h;$!d' |
grep |
sed '/patt/!d' |
grep -v |
sed '/patt/d' |
head |
sed '10q' |
tail |
sed -e ':a' -e '$q;N;11,$D;ba' |
tail -f |
sed -u '/./!d' |
cut -c 10 |
sed 's/\(.\)\{10\}.*/\1/' |
cut -d: -f4 |
sed 's/\(\([^:]*\):\)\{4\}.*/\2/' |
tr A-Z a-z |
sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' |
wc -l |
sed -n '$=' |
uniq |
sed 'N;/^\(.*\)\n\1$/!P;D' |
rev |
sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//' |
basename |
sed 's,.*/,,' |
dirname |
sed 's,[^/]*$,,' |
cp orig new |
sed 'w new' orig |
- SED emulating UNIX commands - http://sed.sourceforge.net/local/docs/emulating_unix.txt