Linux Commands for Beginners: Learn These 15 First
The terminal looks like it demands memorizing hundreds of commands. It doesn't. Fifteen commands cover the overwhelming majority of what anyone: developer, sysadmin or curious user: actually types in a day. This guide gives them to you in learning order, with the mental model that ties them together.
The mental model: you are always somewhere
Everything in Linux lives in one tree of directories starting at / (the root). Your shell is always "standing" in exactly one directory: the working directory, and every command you run is interpreted from there. That's the whole model. The first three commands manage it:
pwd, where am I? Prints your current path.ls: what's here? Lists the directory.ls -lashows details and hidden files.cd: go somewhere.cd projectsenters,cd ..goes up,cdalone goes home.
Spend your first session just walking around with these three. Seriously: fluency here makes everything else easy.
Making and unmaking things
mkdir: create directories.mkdir -p a/b/cbuilds a whole nested path.touch: create empty files.cp: copy.cp -rfor directories.mv: move and rename; they're the same operation.rm: delete. There is no trash bin.rm -rremoves directories; read twice before Enter.
Reading and searching
cat: print a file to the screen. Perfect for small files.less: scroll through big files: arrows to move,/to search,qto quit.grep: find lines containing text:grep error app.log. The single most useful command on this list.find: find files by name:find . -name "*.pdf".
The survival kit
chmod: make scripts runnable:chmod +x script.sh. (Full story: permissions guide.)man: the built-in manual:man lsdocuments every option.qexits.history: your past commands. Better yet, press Ctrl+R and type a fragment to search them.
Three habits that accelerate everything
- Tab completion. Type the first letters of any file or command and press Tab. It completes the name or shows the options. Nobody types full paths.
- Arrow up. Recalls previous commands for editing and re-running.
- Read the error. Linux errors are short and literal: "No such file or directory" means exactly that: check
pwdandls, and the answer is usually there.
Practice right now
This is a real simulated terminal. Try the first three commands, pwd, ls, cd documents, then create and delete something:
Where to go next
The interactive course turns this list into 60 checked exercises: the fastest route to muscle memory. Then keep the cheat sheet nearby and dip into the reference whenever a command surprises you.