Count how many times a file was accessed via Apache

cat access.log | grep "my_file.php" | wc -l

This command is fairly generic and will return the amount of rows in a file after applying the grep search string.

And grep does regular expressions too!

Leave a Reply

Your email address will not be published. Required fields are marked *

Markdown is allowed in comments.