Difference between revisions of "alter file with sed"

From thelinuxwiki
Jump to: navigation, search
(Pushed from Themanclub.)
 
 
Line 3: Line 3:
 
  sed -i ''expression filename''
 
  sed -i ''expression filename''
  
 +
 +
== examples ==
 +
delete lines containing word exit in bash history file
 +
$ sed -i '/^exit$/d' ~/.bash_history
  
 
[[category:linux]]
 
[[category:linux]]

Latest revision as of 14:43, 1 March 2019

permanently alter file

sed -i expression filename


examples

delete lines containing word exit in bash history file

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