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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With