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

Why is shebang used?

0 Answers  


What are file commands?

0 Answers  


What is the basic difference between unix and windows operating systems?

43 Answers   Bopro, College School Exams Tests, CTS, IBM, IT-Kids, Priyadarshini, Sybian Technologies, Tolani Maritime,


What is command statement?

0 Answers  


What is the function of grep command in unix?

0 Answers  


solaris Run level?

3 Answers   Wipro,


What is the difference between cat and more command?

0 Answers  


What does find command return in unix?

0 Answers  


If we want to see first 35 lines of a file which command we have to use?

8 Answers  


What is the difference between a hard link and a soft link in Unix?

1 Answers  


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

2 Answers   Infosys,


How can you create a symbolic link to a file or directory?

1 Answers  


Categories