Linux Command Line — Your First 12 Commands
Free skillWhat this is and why it matters
Linux is the operating system that runs almost every server, cloud machine and container in the world.
DevOps work means working on those machines, and most of them have no mouse and no windows — only a terminal where you type commands.
In this lesson you learn the 12 commands that cover about 80% of daily terminal work. You practise each one in a safe browser terminal. Nothing you type here can break anything.
1. Where am I, and what is here?
pwd prints the folder you are standing in. ls lists what is inside it. Think of a folder like a drawer: pwd tells you which drawer is open, ls shows what is inside.
cat file.txt prints the text inside a file.
2. Make folders and move around
mkdir projects makes a new folder. cd projects goes into it. cd .. goes back up one level. cd alone brings you home.
3. Create and fill files
touch notes.txt creates an empty file. echo "hello" > notes.txt writes text into a file (the > arrow means “send the output into this file” and it replaces what was there). Use >> instead to add to the end.
4. Copy, rename, delete
cp a.txt b.txt copies. mv a.txt b.txt moves or renames. rm b.txt deletes — and there is no recycle bin. Deleted means gone, so read the command twice before pressing Enter.
Common mistakes
- Typing a command in the wrong folder. Run
pwdwhen unsure. - Using
>when you meant>>, which wipes the file. - Spaces in file names. Prefer
my-notes.txtovermy notes.txt.
Practice in the browser
Open the practice terminal and follow the 13 steps. It is free, needs no install and works on your phone.
Quick check — try it yourself
Question: You are in the projects folder. Which command takes you back to your home folder?
Show answer
cd .. goes up one level. If projects is directly inside your home folder, that lands in home. (Plain cd also goes straight home from anywhere.)