Insert a line (2nd line)

sed -i -e "2i\test-insertion-line" name-file

Delete a line begin

sed -i -e '/^test-insertion-line/d'

Delete comment lines in file

sed -e '/^[ ]*#/d' -e '/^$/d' file.txt > file.new

Share on: TwitterFacebookEmail


Related Posts


Published

Category

Notes

Tags

Contact