Return to Snippet

Revision: 23273
at February 3, 2010 04:27 by edeustace


Initial Code
tail -f /myFile.log | grep 'string_to_find'

# for a log file
# 1: hello
# 2: string_to_find on line 2
# 3: hello again

# the command above will output: 
# string_to_find on line 2

# to do an invert match just use -v with grep
# tail -f /myFile.log | grep -v 'string_to_ignore'

Initial URL

                                

Initial Description
When tailing a log file, its sometimes handy to only show parts of it that you are interested in, this simple pipe does the job.

Initial Title
Filter the output of a tail

Initial Tags
filter

Initial Language
Bash