Learning Unix for OS X Mountain Lion by Dave Taylor

Learning Unix for OS X Mountain Lion by Dave Taylor

Author:Dave Taylor [Dave Taylor]
Language: eng
Format: epub, pdf
Tags: COMPUTERS / Operating Systems / Macintosh
ISBN: 9781449332266
Publisher: O'Reilly Media
Published: 2012-09-18T16:00:00+00:00


Counting matches rather than showing matching lines

When you’re going through a large file and have a lot of matches, it’s often quite useful to just get a report of how many lines matched rather than having all the output stream past on your screen. This is accomplished with the -c option:

$ grep -c "kernel" /var/log/system.log 160

You can also accomplish this result by piping the output to the wc command, as shown in Chapter 6, but this is considerably faster!

Working with Regular Expressions



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.