Essential Linux commands
A quick-reference guide for efficient terminal management.
This guide covers the most frequently used Linux commands to help you navigate, manage, and troubleshoot your server with confidence and speed.
System information
uname -r # Show Linux kernel version
uname -a # Detailed system information
arch # Display processor architecture
cat /proc/cpuinfo # View CPU specifications
cat /proc/meminfo # Detailed memory statistics
cat /proc/swaps # Show swap partition information
free -h # Display memory usage (human-readable)
df -h # Show disk space usage
lsblk # List all block devices (disks and partitions)
dmidecode -q # Get hardware component info from BIOS
lspci -tv # List PCI devices in a tree view
lsusb -tv # List USB devices in a tree view
date # Display current date and time
Power management
reboot # Restart the system immediately
shutdown -h now # Power off the server immediately
shutdown -r now # Reboot the server immediately
shutdown -h 22:00 # Schedule a shutdown at 22:00
shutdown -c # Cancel a scheduled shutdown
File and directory operations
pwd # Print the current working directory
ls # List files in the current directory
ls -la # Show all files, including hidden ones (.dotfiles)
ls -lh # List files with human-readable sizes
cd /path/to/dir # Change to a specific directory
cd .. # Move up one directory level
cd ~ # Jump to the user's home directory
cd - # Switch back to the previous directory
mkdir folder # Create a new directory
mkdir -p /path/to/folder # Create nested directories (parent folders included)
cp file1 file2 # Copy a file
cp -r dir1 dir2 # Copy a directory and its contents recursively
mv file1 file2 # Rename or move a file/directory
rm file # Delete a file
rm -rf folder # Force-delete a folder and all its contents (use with caution!)
ln -s file link # Create a symbolic link
Search and filtering
find / -name filename # Search for a file by name starting from root
find /var/www -name "*.php" # Find all .php files in a specific directory
grep "text" file # Search for a specific string within a file
grep -r "text" /path # Recursively search for a string across all files in a path
locate filename # Fast search via database (update it using 'updatedb')
whereis command # Locate binary, source, and manual page for a command
which command # Identify the path of the executable being run
Storage and file systems
df -h # Check disk usage across all mounted systems
du -sh /path # Display total size of a specific directory
lsblk # Overview of disks and partitions
mount # List all currently mounted file systems
umount /dev/sda1 # Unmount a specific partition
Our products and services
Users and permissions
whoami # Identify the current logged-in user
id # Show UID, GID, and groups for the current user
cat /etc/passwd # View the list of all system users
cat /etc/group # View the list of all system groups
useradd username # Create a new system user
passwd username # Set or change a user's password
userdel -r username # Delete a user and their home directory
groupadd groupname # Create a new user group
usermod -aG group username # Add an existing user to a group
Networking
ip addr # Display network interfaces and IP addresses
ip route # Show the system routing table
ping host # Check connectivity to a host
curl -I domain.com # Fetch HTTP headers from a website
wget url # Download a file from the internet
netstat -tuln # List active connections and listening ports
ss -tuln # Modern, faster alternative to netstat
Pro tips
- RTFM: use
man commandorcommand --helpto access documentation for any utility. - Paging: for long outputs, pipe the result to
| lessor| moreto scroll comfortably. - Piping: combine multiple commands using the pipe operator (
|) to filter and process data on the fly.
Help
If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!