Usage sed

 

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

Comments

Popular posts from this blog

Install Gitea on NAS Netgear

Send mail with from on Linux