Linux Ubuntu Commands Cheat Sheet

A clean 3D tech scene showing a dark-themed Linux terminal window with command lines like _sudo apt update_, _cd _var_, and _ls -l_ floating in perspective view. Add overlay text_ _Essential Linux Basic Co-Bc7krXx3oq.jpg

I always get confused which linux command to use when. So i decided to make this list. It's simple and should help even if you just started.

Most Useful Linux Basic Commands with Examples

Update and Package Management

Linux basic commands for packages

 
# Update list of packages
sudo apt update

# Upgrade installed packages
sudo apt upgrade

# Install a package
sudo apt install <package_name>

# Remove a package
sudo apt remove <package_name>

# Search a package
apt search <package_name>
 

File and Directory Management

Navigate and organize files easily

 
# List files and folders
ls

# Change directory
cd <directory>

# Make new directory
mkdir <directory_name>

# Remove a directory
rmdir <directory_name>

# Copy files
cp <source> <destination>

# Move or rename file
mv <source> <destination>

# Delete a file
rm <file_name>
 

File Permissions & Ownership

Control who can access what

 
# Change file permissions
chmod <permissions> <file_name>

# Change file ownership
chown <user>:<group> <file_name>
 

System Monitoring

Linux commands to check system health

 
# Disk usage
df -h

# Memory usage
free -h

# List processes
ps aux

# Real-time CPU usage
top
htop
 

Networking Commands

Check connectivity and ports

 
# Show IP address
ip a
ifconfig

# Ping a host
ping <host>

# Check open ports
netstat -tuln
 

Apache Web Server

Basic apachectl commands

 
# Restart Apache
sudo systemctl restart apache2

# Stop Apache
sudo systemctl stop apache2

# Start Apache
sudo systemctl start apache2

# Check Apache status
sudo systemctl status apache2
 

User Management

Manage users in your system

 
# Add user
sudo adduser <username>

# Delete user
sudo deluser <username>

# Change user password
sudo passwd <username>
 

More Package Commands

Extra Linux basic commands for packages

 
# List all installed packages
dpkg --list

# Show package details
apt show <package_name>

# Clean cache
sudo apt autoremove
sudo apt clean
 

Log Files

View and tail logs

 
# View a log file
cat /var/log/<log_file>

# Follow real-time logs
tail -f /var/log/<log_file>
 

Customize Linux Prompt

Make your terminal prompt cool

 
# Change your bash prompt
export PS1="[\u@\h \W]\$ "
 

More Handy Linux Commands

Commands I use daily

 
# Search text in files
grep "search_term" filename

# Show command history
history

# Clear terminal screen
clear

# Check system uptime
uptime

# Shutdown system
sudo shutdown now
 

In my experience, learning these Linux basic commands saved me a lot of time during server work and debugging. Whether you're a beginner or a pro, knowing these helps a lot in everyday tasks.

Author
No Image
Admin
MmantraTech

Mmantra Tech is a online platform that provides knowledge (in the form of blog and articles) into a wide range of subjects .

Write a Response