... and redirect the filtered output into another file? So, basically what is saved in the new file is only the configuration lines without all the comment lines (ie. lines starting with #).
Thanks !
Archived thread 100355 from Absolute Beginner Talk. Markdown source: Absolute_Beginner_Talk/thread_100355_Is_there_a_way_to_filter_out_comment_lines_from_co.md
... and redirect the filtered output into another file? So, basically what is saved in the new file is only the configuration lines without all the comment lines (ie. lines starting with #).
Thanks !
Hi Akhran,
There certainly is. If the file you wanted to copy without comments was /home/akhran/input.txt then the following command will strip the comments out for you and save a file in the same location called output.txt:
cat /home/akhran/input.txt | grep -v "#" > /home/akhran/output.txt
Hope this helps, Chris