What you'll learn
Quick Answer
Learn cd, ls, cat, less, grep, find, wc, sort, uniq, head, tail and chmod. Then learn the pipe, which sends one command's output into the next. Most useful command lines are three small commands joined by pipes, not one clever command.
Why this is worth an afternoon
Almost every server runs Linux. Deployments, logs, CI pipelines and most developer tooling assume you can work in a terminal. It also appears in interviews — not as trivia, but as "here is a log file, find out how many errors it contains".
The good news is that the useful subset is small, and it composes. Learning twelve commands and one operator gets you further than memorising fifty in isolation.
On Windows you can follow along with Git Bash or WSL; both give you a real shell.
Moving around and looking at files
pwd— where am Ils— what is here.ls -laadds hidden files and details.cd folder— go in.cd ..— go up.cdalone — home.cat file— dump a whole file.less file— page through a big one (qto quit).head -5 file/tail -5 file— first or last five lines.tail -ffollows a file as it grows, which is how you watch a live log.
Given a file of fruit names, one per line:
$ head -2 fruits.txt
apple
banana
tab completes file names, and the up arrow recalls previous commands. Those two habits save more time than any individual command.
Searching: grep and find
grep searches inside files. find searches for files.
$ grep -c ERROR app.log
2
$ grep -n ERROR app.log
1:ERROR disk full
3:ERROR timeout
-c counts matches, -n shows line numbers, -i ignores case, and -r searches a whole directory tree. That last one is how you find where a function is defined in an unfamiliar codebase.
$ find project -name "*.py"
project/src/main.py
project/src/util.py
Being able to answer "how many errors are in this log" and "where is this string used" covers a large share of real terminal use.
The pipe, which is the actual skill
The | character sends the output of one command into the next as input. Small commands become a pipeline that answers a real question.
The classic — count how many times each line appears, most frequent first:
$ sort fruits.txt | uniq -c | sort -rn
3 apple
2 banana
1 cherry
Three commands, three steps. sort puts identical lines next to each other, uniq -c collapses runs of identical lines and prefixes a count, and sort -rn sorts that numerically in reverse. uniq only removes adjacent duplicates, which is exactly why the first sort is required — leave it out and you get wrong answers with no error.
Swap in a log file and you have the most common error in a production system. Swap in a list of IP addresses and you have your top visitors. This one pattern replaces a lot of small scripts.
$ wc -l < fruits.txt
6
wc -l counts lines, and it is frequently the last stage of a pipeline when you only want the total.
Permissions, briefly
In ls -la output, the leading string like -rw-r--r-- is the permissions: read, write and execute, for the owner, the group, and everyone else.
The one you will actually need is making a script runnable:
chmod +x deploy.sh
./deploy.sh
If you have ever seen "permission denied" when running your own script, this is why. You will also meet numeric forms like chmod 755, which is the same idea written in octal.
A word of caution: chmod 777 appears in a lot of tutorials as a fix for permission problems. It gives everyone full access and is almost never the right answer on a real server. If a tutorial tells you to run it, treat that as a signal to understand the actual problem.
What to learn after these
Once the above feels natural, the next genuinely useful additions are ssh for connecting to a server, scp or rsync for copying files to one, and ps and kill for looking at and stopping processes. Those five turn "I can use a terminal" into "I can deploy and debug a server".
They are also exactly what you need when you put a project online — see how to deploy your project for free.
