alter file with sed

From thelinuxwiki
Jump to: navigation, search

permanently alter file

sed -i expression filename


examples

delete lines containing word exit in bash history file

$ sed -i '/^exit$/d' ~/.bash_history