Basic Linux Commands for Beginners (The 20 You'll Use Every Day)

There are thousands of Linux commands. You'll use about twenty of them nearly every time you log in. Learn these and the rest of this series will make sense.
Quick reference
| Command | What it does |
|---|---|
| pwd | Show which folder you're in |
| ls -la | List files, including hidden ones, with details |
| cd folder | Go into a folder (cd .. goes up, cd alone goes home) |
| cat file | Show a file's contents |
| less file | Read a long file a page at a time (q to quit) |
| cp a b | Copy |
| mv a b | Move or rename |
| rm file | Delete (no recycle bin!) |
| mkdir folder | Make a folder |
Finding your way around
pwd
Prints the folder you're in, such as /home/john. Your home folder is also written ~.
ls
ls -la
Lists what's here. -l gives the long view (size, owner, date), -a includes hidden files (the ones starting with a dot).
cd /etc
cd ..
cd
Changes folder. .. is the folder above; cd on its own takes you home. Press Tab while typing a name and the terminal finishes it for you — use this constantly.
Looking at files
cat file.txt
less /var/log/syslog
head -n 20 file.txt
tail -f /var/log/syslog
cat dumps the whole file. less lets you scroll (arrow keys, Space for a page, q to quit, /word to search). head shows the first lines, tail the last — and tail -f keeps watching as new lines arrive, which is perfect for logs. Ctrl + C stops it.
Copying, moving, deleting
cp report.txt report-backup.txt
cp -r photos photos-backup
mv old-name.txt new-name.txt
mv file.txt /home/john/documents/
rm file.txt
rm -r old-folder
-r means recursive — needed for folders. mv both moves and renames. There is no undo for rm: the file is gone. Never type rm -rf / or anything close to it.
Making things
mkdir projects
mkdir -p projects/2026/photos
touch notes.txt
-p creates the whole path in one go. touch creates an empty file.
Finding things
find / -name "*.log" 2>/dev/null
grep -r "error" /var/log/
find searches by name, grep searches inside files. The 2>/dev/null hides "permission denied" noise.
Getting help
man ls
ls --help
man opens the manual (press q to leave). --help gives a shorter summary.
Things that trip beginners up
- Case matters. File.txt and file.txt are different files.
- Spaces in names need quotes: cd "My Documents".
- Nothing happens is usually success. Linux is quiet when a command works.
- Up arrow brings back previous commands. Ctrl + R searches your history.
- Ctrl + C cancels the running command. Ctrl + D logs out.
- clear (or Ctrl + L) tidies the screen.
Wrapping up
pwd, ls, cd to move; cat, less, tail to read; cp, mv, rm, mkdir to change things; man when stuck. Use Tab to complete names and the up arrow to repeat yourself. That's the whole foundation.
