The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
How to count lines - ignoring blank lines and commented lines
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
How to count lines - ignoring blank lines and commented lines
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
05-24-2007
matrixmadhan
Technorati Master
Join Date: Mar 2005
Location: k-tier distributed caching
Posts: 2,736
Quote:
#egrep -cv '#|^$' active_servers
this displayed the total but on screen only, not in the file
If you had rather need the output on file, redirect that.
Code:
egrep -cv '#|^$' active_servers > somefilename
matrixmadhan
View Public Profile
Find all posts by matrixmadhan