Here is the terminal's real power: each command does one small job, and | (the pipe) makes one command's output the next one's input. You solve a large job with a chain of small commands instead of one giant command.
grep WARN app.log | wc -lcut -d" " -f1 visits.log | sort | uniq -c | sort -rn | head -n 3grep WARN app.log > warnings.txt
wc -l counts lines). The second is a classic: take the first column of every line, sort, count the equal ones (uniq -c), sort by the count from large to small, show the top three. The third writes the result to a file instead of the screen.Build a pipeline step by step: run the first command and look at its output, then add one | and look again. If something in the middle of the chain is not what you expect, you see at once where it went wrong.