what is the cmd to remove the comment lines from a file and
to display the original text without comments?
thanks in advance......

Answers were Sorted based on User's Feedback



what is the cmd to remove the comment lines from a file and to display the original text without c..

Answer / sandip

sed '/^#/d' filename

Is This Answer Correct ?    9 Yes 6 No

what is the cmd to remove the comment lines from a file and to display the original text without c..

Answer / srividya

sed '/^#/ d'

Is This Answer Correct ?    6 Yes 4 No

what is the cmd to remove the comment lines from a file and to display the original text without c..

Answer / susanta polley

sed -e 's/^#//g' input_filename > output_filename

Is This Answer Correct ?    4 Yes 2 No

what is the cmd to remove the comment lines from a file and to display the original text without c..

Answer / deepak

sed -e 's/^#//g' -e 's/#//g' input_filename > output_filename


Is This Answer Correct ?    6 Yes 5 No

what is the cmd to remove the comment lines from a file and to display the original text without c..

Answer / giri

grep -v '#' input_filename > output_filename

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Unix Commands Interview Questions

What do chown command do?

0 Answers  


Explain how to use grep command to list find the records of a file containing 10 different strings?

0 Answers  


who to change the duplex setting of network interface in command line

1 Answers  


What do know about tee command and its usage?

0 Answers  


What do chmod, chown, chgrp commands do?

0 Answers  






Describe the zip/unzip command using gzip.

0 Answers  


What are the dos commands?

0 Answers  


how unix kernel distinguishes between a normal file and device file ?

7 Answers   Google, IBM, McAfee, Vodafone,


How do I use grep to find a file?

0 Answers  


How to setup sudo, only can use for particular date & time only ( for solaris10 )

1 Answers   ups,


Which unix command lists files/folders in alphabetical order?

0 Answers  


Will rm -r* removes hidden files?

10 Answers  


Categories