If you’re new to Ubuntu or Linux, you’ve probably noticed that a lot of modern technology — from cloud computing to data engineering — depends on the command line.
This post gives you the Ubuntu essentials you’ll use every day. It’s written for beginners who want to feel confident navigating, editing, and managing files on Linux — whether you’re using it directly or through Windows with WSL2.
🧩 Before You Begin
If you’re using Windows and have not yet set up WSL2, check out our post Getting Started with WSL2: Run Linux Inside Windows first.
Once your Ubuntu environment is ready, come back here to learn the most useful commands.
🧭 1. Navigating the File System
| Command | Purpose | Example |
|---|---|---|
pwd | Print Working Directory – shows your current location | pwd → /home/username |
ls | List files and folders | ls -l shows details; ls -a includes hidden files |
cd | Change directory | cd Documents or cd /etc |
cd .. | Move up one level | Go back to the parent folder |
clear | Clear the terminal screen | Makes the view cleaner |
💡 Tip: Press Tab to autocomplete file and folder names.
🧱 2. Working with Files and Directories
| Command | Description | Example |
|---|---|---|
mkdir | Create a new directory | mkdir myproject |
rmdir | Remove an empty directory | rmdir oldfolder |
cp | Copy files or folders | cp file1.txt file2.txt |
mv | Move or rename | mv file.txt newfolder/ or mv old.txt new.txt |
rm | Delete files | rm file.txt — ⚠️ irreversible! |
touch | Create an empty file | touch notes.txt |
cat | View the contents of a file | cat readme.txt |
nano | Open a simple text editor | nano readme.txt (save: Ctrl + O, exit: Ctrl + X) |
🧠 Pro Tip: Use rm -r foldername to delete folders recursively, but always double-check before pressing Enter.
⚙️ 3. Managing Software and Updates
Ubuntu uses APT (Advanced Package Tool) to manage software. You’ll use it for installing, updating, and removing packages.
| Command | Purpose |
|---|---|
sudo apt update | Updates the list of available software |
sudo apt upgrade | Installs updates for your system |
sudo apt install packagename | Installs a specific package |
sudo apt remove packagename | Uninstalls a package |
sudo apt autoremove | Cleans up unused dependencies |
Example:
sudo apt update && sudo apt install curl -y
💡 The -y flag automatically confirms installation prompts.
🔒 4. Understanding sudo and Permissions
sudo means “superuser do.”
It temporarily gives you administrative privileges — similar to “Run as Administrator” on Windows.
When you run:
sudo apt install git
Ubuntu asks for your user password to confirm you’re authorized to make system-level changes.
⚙️ You’ll only need to enter it once per session — Ubuntu remembers it for a few minutes.
🧰 5. Viewing and Searching Files
| Command | Description |
|---|---|
less filename | Opens a file for scrolling view (exit with q) |
head -n 10 file.txt | Shows the first 10 lines |
tail -n 10 file.txt | Shows the last 10 lines |
grep "word" filename | Searches for a specific word or phrase in a file |
Example:
grep "error" logs.txt
Finds all lines containing “error” in your log file.
🌐 6. Checking System and Network Information
| Command | Purpose |
|---|---|
hostname | Displays your system name |
ip a | Shows network interfaces and IP addresses |
ping google.com | Tests internet connectivity |
uname -a | Displays Linux kernel and system details |
df -h | Shows disk space usage |
free -m | Displays available memory in MB |
🧠 These commands are handy for troubleshooting or checking system health.
👥 7. Managing Users and Processes
| Command | Function |
|---|---|
whoami | Displays your current username |
top | Shows active processes (exit with q) |
ps aux | Lists running processes in detail |
kill <process_id> | Stops a specific process |
history | Lists recently executed commands |
sudo shutdown now | Shuts down the system (use with care) |
🧹 8. Useful Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl + C | Cancel the current command |
Ctrl + L | Clear the terminal screen |
↑ / ↓ | Browse command history |
Tab Tab | Show possible completions |
Ctrl + R | Search through previous commands |
Mastering these shortcuts will make you much faster in the terminal.
🧾 Summary
Ubuntu is beginner-friendly once you learn the basic commands.
You now know how to:
- Navigate directories
- Create, view, and delete files
- Install and update software
- Manage permissions and processes
- View system and network info
These are the core commands used daily by anyone working in a Linux environment — from developers and engineers to students and hobbyists.