Linux Tutorial for Beginners: A Hands-On Path to Using the Command Line
Updated
You can learn Linux from scratch by working through six concrete milestones: get a terminal, navigate the filesystem, manage files, understand users and permissions, install software with a package manager, and edit configuration files. Each step below gives you the exact command, what it does, and how to confirm it worked. This path suits complete beginners who want command-line skills for everyday use or system administration; it assumes no prior Linux experience but does assume you can install software or open a browser on your current machine.
Step 1: Get a Linux environment and open a terminal
You need a running Linux system before anything else. Four common options:
| Option | Best for | Trade-off |
|---|---|---|
| Native install (dual-boot or full disk) | Long-term daily use | Requires repartitioning; risk to existing data |
| Virtual machine (VirtualBox, VMware) | Safe experimentation | Uses significant RAM and disk |
| WSL (Windows Subsystem for Linux) | Windows users who want quick access | Not a full Linux kernel environment in all respects |
| Browser-based lab | Trying commands with zero setup | Session may be temporary |
Once inside, open a terminal — the application that accepts typed commands. On most desktop distributions it's called Terminal, Konsole, or GNOME Terminal. You'll see a prompt ending in $ (normal user) or # (root).
Verify: type whoami and press Enter. Expected result: your username printed on the next line. If you see an error, you're not in a shell — reopen the terminal.
Step 2: Navigate the filesystem
Linux organizes everything under a single root directory /. Your starting location is your home directory, typically /home/yourname.
pwd # print working directory — shows where you are
ls # list files in the current directory
ls -la # list all files, including hidden ones, with details
cd /etc # change to the /etc directory
cd .. # go up one level
cd ~ # return to your home directory
Verify: run pwd after each cd. The output should match the directory you intended. If cd fails with "No such file or directory," check spelling — Linux paths are case-sensitive.
Common pitfall: cd with no argument also returns you home, but cd - returns you to the previous directory, which is different.
Step 3: Manage files and directories
mkdir projects # create a directory
touch notes.txt # create an empty file
cp notes.txt backup.txt # copy a file
mv backup.txt projects/ # move a file into a directory
rm notes.txt # delete a file
rm -r projects # delete a directory and its contents
Verify: run ls after each operation and confirm the file appears or disappears as expected.
Warning: rm deletes permanently — there is no recycle bin on the command line. Never run rm -r on a path you haven't checked with ls first.
Step 4: Understand users, permissions, and sudo
Every file has an owner, a group, and permission bits for read (r), write (w), and execute (x). Running ls -l shows them:
-rw-r--r-- 1 alice users 1024 Jan 1 12:00 notes.txt
The first character is the file type; the next nine are permissions for owner, group, and others.
chmod +x script.sh # make a file executable
sudo apt update # run a command as the superuser
sudo lets a permitted user run a single command with root privileges. You'll be asked for your own password, not root's.
Verify: ls -l script.sh should now show x in the owner permissions.
Common pitfall: "Permission denied" usually means you lack write or execute rights on that file or directory. Check with ls -l before reaching for sudo — using it unnecessarily can change file ownership in ways that cause later problems.
Step 5: Install and remove software with a package manager
Each distribution family uses its own tool:
| Distribution family | Install | Update index | Remove |
|---|---|---|---|
| Debian/Ubuntu | sudo apt install <pkg> |
sudo apt update |
sudo apt remove <pkg> |
| Fedora/RHEL | sudo dnf install <pkg> |
sudo dnf check-update |
sudo dnf remove <pkg> |
| Arch | sudo pacman -S <pkg> |
sudo pacman -Sy |
sudo pacman -R <pkg> |
Verify: after installing, run the program's name (e.g., htop) or check with which <pkg>. If it prints a path, the install succeeded.
Common pitfall: "command not found" after a successful install often means the binary is in a directory not on your PATH, or the package name differs from the command name. Search with your package manager's search subcommand (e.g., apt search).
Step 6: Read and edit configuration files
Most Linux settings live in plain-text files, usually under /etc. Start with nano — it shows its own keyboard shortcuts at the bottom of the screen.
nano ~/.bashrc # edit your shell configuration
Inside nano: Ctrl+O saves, Ctrl+X exits. For larger edits, vim is more powerful but has a steeper learning curve — start with nano and move on when you're comfortable.
Verify: after editing, run cat ~/.bashrc to confirm your change is present, then source ~/.bashrc to apply it to the current session.
Troubleshooting the two errors beginners hit most
"command not found" — the shell can't locate the program. Check spelling, confirm the package is installed (which <command>), or verify the directory containing it is in your PATH (echo $PATH).
"permission denied" — you lack the required permission. Inspect with ls -l, then either use sudo for a legitimate system task or change ownership/permissions with chown/chmod if appropriate.
Where to go next
Once these six steps feel routine, extend into networking basics (ip, ping, ss), process management (ps, top, kill), and shell scripting. Structured, hands-on lesson paths — such as the original Linux Journey lessons now hosted on LabEx — let you practice each topic in an interactive environment rather than reading passively. The fastest way to retain any of this is to repeat each command on your own system until you no longer need to look it up.