sed is a powerfull tool and you can find all details from here
delete a line containing a substring ("pattern")
sed -i '/pattern/d' file
replace a string
sed -e s/pattern//g -i file
using i.backup will keep a backup file of original and it is safer.
sed -e "s/pattern//g" -i.backup file
No comments:
Post a Comment