Experiments with Linux and Related Technologies
Sunday, 13 April 2014
Remove comments from a file on Linux with sed
You can quickly remove comments from a file on Linux using sed. For example if the comment starts with #.
$ sed '/^\#/d' filewithcomments.txt > filewithcomments.tmp
$ mv filewithcomments.tmp filewithcomments.txt
$ rm filewithcomments.tmp
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment