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

Which command is used to find whether the system is 32 bit or 64 bit?

0 Answers  


What is the search command in unix?

0 Answers  


Explain ‘system calls’ with respect to unix commands?

0 Answers  


what is the use of the hidden files?

3 Answers  


What difference between cmp and diff commands?

0 Answers  






why unix operating system provides more security than other operating systems?

4 Answers  


what is the advaantage of each user having its own copy of the shell?

2 Answers   Infosys,


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

7 Answers   Google, IBM, McAfee, Vodafone,


distinguish between user mode and kernel mode?

6 Answers   Infosys,


what is the use of wild cards?

2 Answers  


How do you grep recursively?

0 Answers  


How do you execute a UNIX command in the background?

6 Answers  


Categories