Overview of all 10 commands
Quick reference for all 10
① pwd (Print Working Directory): displays the full path of your current location. Type it first whenever you wonder "wait, where am I?"
② ls (List): lists the files in your current folder. ls -l for details; ls -a to include hidden files. Combining them as ls -la is the classic combo.
③ cd (Change Directory): navigates to another folder. cd .. goes up one level; cd ~ goes to your home directory; cd / goes to the root (the very top).
④ mkdir / rm: create and delete folders respectively. mkdir test creates a folder called test; rm file.txt deletes a file; to delete a folder and everything inside, use rm -r foldername.
⑤ cp / mv: copy and move. cp a.txt b.txt copies a.txt under the name b.txt; mv a.txt newfolder/ moves it. Renaming is also done with mv.
⑥ cat: prints a file's contents to the screen. Good for short files. For long ones, use less — scroll with arrow keys and press q to quit.
⑦ head / tail: shows the first 10 lines (head) or last 10 lines (tail) of a file. tail -f logfile watches a log in real time — heavily used in server management.
⑧ grep: searches for a string inside files. grep "error" log.txt extracts only the lines in log.txt that contain "error." One of the most-used commands in real-world work.
⑨ find: locates files by name or criteria. find . -name "*.html" lists all HTML files under the current directory.
⑩ man (Manual): displays the official documentation for a command. man ls shows every option for ls. When in doubt, check man first.
Piping commands together
The real power of Linux commands lies in the | (pipe) — the output of one command feeds directly into the next. Chain 3–4 commands together and you can write "extract yesterday's errors from 100 log files and count them" in a single line.
When practicing, start with "viewing" commands rather than deletion or moving — it's safer. Confirm your location with pwd, see what's there with ls, read files with cat or head. Work up to cp, then mv, and leave rm for last. That order minimises the chance of irreversible mistakes.
With pipes too, preview the output first. For example, try grep "error" app.log | head to see just the top lines — once you confirm the right lines are showing, then count them. Commands are fast, so mistakes also hit fast; "confirm then execute" is the rule.
Pitfalls to watch out for
- Never type commands like
rm -rf /— that deletes the entire OS. - With
cpormv, if a file of the same name already exists, it's overwritten without warning. Use the-iflag to prompt for confirmation. grepis case-sensitive by default. Add-iif you want a case-insensitive search.
How will this help you in the future?
These 10 commands are exactly what engineers use every single day — web engineers, server admins, data scientists, machine learning engineers, all of them. Learn them in middle or high school and you'll walk into university information-systems courses already knowing the material.
The real value of knowing commands isn't about memorisation — it's about being able to find information yourself when things go wrong. File missing, error in the log, disk full, permissions denied. People who can extract the information they need by themselves have a big advantage. These 10 basic commands are the entry point to that skill.
Things you can do today
- Open a terminal and run
pwd,ls -la, andcd Documentsin order. - Create a test folder with
mkdir test, enter it withcd test, and create a file withecho "hello" > a.txt. - Check its contents with
cat a.txt, search withgrep "hello" a.txt, and delete withrm a.txtto experience the full cycle.
Summary
| and they become dramatically more powerful — and directly relevant to real engineering work.