← Pipes & Filters
Count the requests
Learn
Commands read and write text
Every command has two text streams: it reads from standard input (stdin) and writes to standard output (stdout). By default stdout goes to your screen, which is why you see a command's answer as soon as it finishes.
Your first tool is wc, short for word count. On its own it prints lines, words
and bytes; -l switches it to lines only:
wc -l access.log
# 5 access.log
It prints the count, then the file it counted. A log has one request per line, so counting lines counts requests: a quick answer to "how busy was the server?"
This sandbox has an access.log with a few requests in it. Type a single command
into the terminal and press Enter.
Your task
How many requests are in access.log? Count its lines with wc -l.