Ubuntu Terminal Commands Guide
File & Directory Commands
ls - List files in the current directory
ls -l - Long listing (shows permissions, owners, etc.)
cd [directory] - Change to specified directory
cd .. - Move up one directory
pwd - Show current directory path
mkdir [dir_name] - Create a new directory
rm [file] - Remove a file
rm -r [directory] - Remove a directory and its contents
touch [file] - Create an empty file
File Viewing & Editing
cat [file] - Show file contents
less [file] - View file one page at a time
nano [file] - Edit file using the nano text editor
vim [file] - Edit file using the vim editor
cp [src] [dest] - Copy files or directories
mv [src] [dest] - Move/rename files or directories
System Info & Utilities
date - Show current date and time
cal - Show current month's calendar
cal 2025 - Show calendar for the year 2025
uptime - Show how long the system has been running
df -h - Show disk space usage in human-readable form
free -h - Show memory usage
Manual Pages & Help
man [command] - Show the manual for a command (e.g., man ls)
[command] --help - Show help/usage for a command
Ubuntu Terminal Commands Guide
Networking & Internet
ping [host] - Test network connection to a host (e.g., ping google.com)
ip a - Show IP address and network interfaces
curl [url] - Fetch content from a URL
wget [url] - Download a file from a URL
System Management (with sudo)
sudo apt update - Update package list
sudo apt upgrade - Upgrade all upgradable packages
sudo apt install [package] - Install a package
sudo reboot - Restart the system
sudo shutdown now - Shutdown the system immediately