ssh tail output lines only with keyword

12,324

You can pipe the output of tail and use grep. To

filter so it only displays lines that contain a particular keyword in them

you could do:

tail /usr/local/apache/logs/access_log | grep "keyword" 

where you'd replace keyword with your keyword.

Share:
12,324
sven30
Author by

sven30

Updated on June 22, 2022

Comments

  • sven30
    sven30 almost 2 years

    I'm trying to tail a large file in an ssh command prompt, but I need to filter it so it only displays lines that contain a particular keyword in them.

    I'm using this command currently to tail.

    # tail /usr/local/apache/logs/access_log
    

    If possible please let me know what I would add to this command to accomplish this.