Linux Ubuntu Commands Cheat Sheet
- Posted on July 21, 2024
- Cheat Sheet
- By MmantraTech
- 193 Views

Basic Commands
- Update Package List:
sudo apt update
- Upgrade Packages:
sudo apt upgrade
- Install Package:
sudo apt install <package_name>
- Remove Package:
sudo apt remove <package_name>
- Search Package:
apt search <package_name>
File and Directory Management
- List Files:
ls
- Change Directory:
cd <directory>
- Create Directory:
mkdir <directory_name>
- Remove Directory:
rmdir <directory_name>
- Copy File:
cp <source> <destination>
- Move/Rename File:
mv <source> <destination>
- Remove File:
rm <file_name>
File Permissions
- Change Permissions:
chmod <permissions> <file_name>
- Change Ownership:
chown <user>:<group> <file_name>
System Information
- Check Disk Usage:
df -h
- Check Memory Usage:
free -h
- List Processes:
ps aux
- Check CPU Usage:
top
orhtop
Networking
- Check IP Address:
ip a
orifconfig
- Ping Host:
ping <host>
- Check Open Ports:
netstat -tuln
Apache 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
- Add User:
sudo adduser <username>
- Delete User:
sudo deluser <username>
- Change User Password:
sudo passwd <username>
Package Management
- List Installed Packages:
dpkg --list
- Show Package Details:
apt show <package_name>
- Clean Package Cache:
sudo apt autoremove
andsudo apt clean
Log Files
- View Log File:
cat /var/log/<log_file>
- Follow Log File:
tail -f /var/log/<log_file>
This should cover the essentials! Let me know if you need more specific commands or details.
Write a Response