Open a terminal with Ctrl+Alt+T on most Ubuntu-based desktops. The terminal is your most powerful tool — don’t be afraid of it.
Navigation
| Command | What It Does | Windows Equivalent |
|---|
pwd | Print current directory | Typing path in Explorer address bar |
ls | List files | dir |
ls -la | List all files including hidden, with details | dir /a |
cd /path | Change directory | cd \path |
cd ~ or just cd | Go to home directory | cd %USERPROFILE% |
cd .. | Go up one directory | same |
cd - | Go to previous directory | no equivalent |
File Operations
| Command | What It Does | Windows Equivalent |
|---|
cp source dest | Copy file | copy |
cp -r source dest | Copy directory recursively | xcopy |
mv source dest | Move/rename | move / ren |
rm file | Delete file | del |
rm -rf directory | Delete directory and everything inside (dangerous!) | rmdir /s |
mkdir -p path/to/dir | Create directory (and parents) | mkdir |
touch file | Create empty file or update timestamp | no equivalent |
cat file | Print file contents | type |
head -n 20 file | Show first 20 lines | no equivalent |
tail -n 20 file | Show last 20 lines | no equivalent |
tail -f file | Follow file updates in real-time (logs) | no equivalent |
Finding Things
| Command | What It Does | Windows Equivalent |
|---|
find /path -name "*.txt" | Find files by name | Search in Explorer |
grep "text" file | Search inside files | findstr |
grep -r "text" /path | Search recursively | findstr /s |
which command | Find where a command lives | where |
locate filename | Fast file search (needs sudo updatedb first) | Everything search |
System Info
| Command | What It Does | Windows Equivalent |
|---|
uname -a | System info | systeminfo |
hostname | Computer name | hostname |
df -h | Disk space | no equivalent |
free -h | Memory usage | Task Manager |
htop | Interactive process viewer | Task Manager |
lscpu | CPU info | Task Manager Details |
sensors | Temperature sensors | no equivalent |
uptime | How long system has been running | systeminfo | find "Boot Time" |
Package Management (apt)
| Command | What It Does | Windows Equivalent |
|---|
sudo apt update | Refresh package list | Check for Updates |
sudo apt upgrade -y | Install all updates | Windows Update |
sudo apt install package | Install software | Download .exe + run |
sudo apt remove package | Uninstall software | Programs & Features |
sudo apt remove --purge package | Uninstall + remove config | no equivalent |
sudo apt autoremove | Remove unused dependencies | no equivalent |
apt search keyword | Search for packages | Microsoft Store search |
dpkg -l | grep keyword | Check if package is installed | no equivalent |
Permissions
| Command | What It Does | Windows Equivalent |
|---|
chmod +x file | Make file executable | no direct equivalent |
chmod 755 file | Set full permissions | Properties > Security |
chown user:group file | Change file owner | Properties > Security |
sudo command | Run as administrator | ”Run as administrator” |
sudo -s | Open root shell | Admin CMD |
Process Management
| Command | What It Does | Windows Equivalent |
|---|
ps aux | List all processes | Task Manager |
kill PID | End a process | End Task |
killall name | Kill all processes by name | no equivalent |
command & | Run in background | no equivalent |
jobs | List background jobs | no equivalent |
Ctrl+C | Stop running command | same |
Ctrl+Z | Suspend command | no equivalent |
Networking
| Command | What It Does | Windows Equivalent |
|---|
ip addr | Show IP addresses | ipconfig |
ping host | Ping | same |
curl URL | Download/fetch URL | no equivalent |
wget URL | Download file | no equivalent |
ss -tulnp | Show listening ports | netstat -an |
Text Editing
| Command | What It Does | Windows Equivalent |
|---|
nano file | Simple text editor (beginner-friendly) | notepad |
vim file | Advanced text editor (steep learning curve) | no equivalent |
nano basics: Arrow keys to move, Ctrl+O to save, Ctrl+X to exit.
Useful Shortcuts
| Shortcut | What It Does |
|---|
Tab | Auto-complete file/directory names |
Up/Down arrows | Scroll through command history |
Ctrl+R | Search command history |
Ctrl+L | Clear screen (same as clear) |
!! | Repeat last command (useful: sudo !!) |
Ctrl+A | Move cursor to start of line |
Ctrl+E | Move cursor to end of line |
Pipes and Redirection
| Syntax | What It Does |
|---|
command | grep "text" | Pipe output to search |
command > file | Redirect output to file (overwrite) |
command >> file | Append output to file |
command 2>&1 | Redirect errors to same output |
command1 && command2 | Run command2 only if command1 succeeds |
command1 || command2 | Run command2 only if command1 fails |
Discussion