sed script to comment/uncomment every line in a file

/ Published in: Bash
Save to your folder(s)

Copy this code and paste it in your HTML
  1. # comment
  2. sed -i 's/^/#/g' /example/file/here.txt
  4. #uncomment
  5. sed -i 's/^#//g' /example/file/here.txt

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.