I have a log file which contains traffic for an entire server. The server serves multiple domains, but I know that all of the PDF files I want to count are in /some/directory/.
I know that I can get a list of all the PDF files I want if I grep that directory for the ‘pdf’ extension.
How can I then count how many times each PDF was accessed individually from the command line?
this is a bit longer than one line but it will give you a better summary. You can modify this with the path to the pdfs and the apache access_log file and just paste it in to the command line or put it in a bash script