How to ignore commented Lines while using cat command in Ubuntu/CentOS/Redhat Linux

How to ignore commented Lines while using cat command in Ubuntu/CentOS/Redhat Linux

Being a System Administrator sometimes we come across a situation when we have to deal with large configuration files, that includes a large no. of commented lines (those begin with #).

With below mentioned command we can neglect those commented lines & print only un-commented lines on screen.

#cat name_of_file | egrep -v ^#

 centos-cat

 In Above shown example, firstly we have printed a the text using simple cat command, it displays all lines on Screen.

After that we used the above mentioned command, it displays only un-commented lines.

Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.