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 stop a running process in unix?

8 Answers  


What is $0 bash?

0 Answers  


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include<stdlib.h> # include <stdio.h> int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

0 Answers  


what is the difference between commmands cmp and diff?

9 Answers   iNautix,


If JFS file system is 100% full how we can increase the file system ?

3 Answers  






What is grep command in unix with examples?

0 Answers  


What will the following command do?

0 Answers  


Assume that a file’s permissions give you read and write access. What operations can you perform on the file if it is in a directory which has “r”(read) only process? What operations can you perform on the file if it is in a directory which has “x”(execute) only access?

1 Answers  


What is the use of tee command?

0 Answers  


What is use of sed command?

12 Answers   BitWise, Infosys, Reliance,


How to view the hidden files in /etc directory?

10 Answers  


what is the command to find out the difference between files and folders?

6 Answers  


Categories