find ./ -type f -iregex ".*e?rb" -exec sed -i -r \
--expression='s|http://tinyerp\.(org\|com)(/edoc)?/?|./|g' '{}' \;
echo 'Hello, World!' | sed --expression=s/World/work/
svn status | grep '^[I?]' | sed 's/^[I?]//' | xargs rm -rf
sed -i --in-place 's/your_old_string/your_new_string/g' path/to/file
sed -i --in-place '42d' ~/.ssh/known_hosts
sed '3,7d' path/to/in/file > path/to/out/file
sed -n '134650000,134900000p' production.log > production-2013-02-18.log
Adds \n at the end of the file only if it doesn’t already end with a newline
http://unix.stackexchange.com/questions/31947/how-to-add-a-newline-to-the-end-of-a-file#31955,
http://unix.stackexchange.com/questions/31947/how-to-add-a-newline-to-the-end-of-a-file#comment-43399.
sed -i --in-place --expression='$a\' ~/.dmenu_history
sed -n --quiet 's/.*skip.*befor\(match.*text\)skip.*after.*/\1/p'
sed -e 's/\(unchangeable str\)str to replace/\1new str/g' path/to/file
http://cyberciti.biz/faq/linux-unix-shell-programming-converting-lowercase-uppercase
tr '[:upper:]' '[:lower:]' < input.txt > output.txt
cat ./file | tr '\n' ' '
cat /etc/ntp.conf | grep -v '^#' | grep -v '^$'