Ubuntu Command-Line Cheat Sheet

This cheat sheet consolidates the most frequently used commands in Ubuntu, one of the most popular Linux distributions. Designed for new and experienced users, this guide offers quick references and examples to help you navigate Ubuntu’s command-line interface efficiently.

Installation Commands

Ubuntu’s package management is primarily handled through apt (Advanced Package Tool). The essential commands for installing, updating, and managing software packages are here.

TaskCommand
Update package listssudo apt update
Upgrade all packagessudo apt upgrade
Install a packagesudo apt install [package_name]
Remove a packagesudo apt remove [package_name]
Search for a packageapt search [keyword]
Display package detailsapt show [package_name]

System Monitoring Commands

Monitoring system performance and resource usage is critical for maintaining an optimal operating environment. Use these commands to check system health and activity.

TaskCommand
View active processestop or htop
Check disk space usagedf -h
Display memory usagefree -m
Monitor all system activityvmstat 1

Network Management Commands

Managing network settings and troubleshooting connectivity issues are common tasks for Ubuntu users. These commands simplify network operations.

TaskCommand
Display all network interfacesifconfig or ip a
Scan network for devicessudo nmap -sn [network/CIDR]
Display routing tableroute -n
Test connectivity to a hostping [hostname_or_IP]

File Management Commands

File management is often performed through the command line when using Ubuntu. Here are some commands to handle files effectively.

TaskCommand
List directory contentsls -al
Change directorycd [directory_path]
Copy a file or directorycp [source] [destination]
Move or rename a filemv [source] [destination]
Delete a filerm [file_name]
Delete a directoryrm -r [directory_name]

User Management Commands

Creating and managing user accounts is a key aspect of system administration. These commands allow you to control user access and privileges.

TaskCommand
Add a new usersudo adduser [new_username]
Delete a usersudo deluser [username]
Add user to a groupsudo usermod -aG [group] [username]
Change user passwordsudo passwd [username]
List user informationid [username]

Wrapping Up

This Ubuntu cheat sheet covers a range of fundamental commands necessary for daily operations, system monitoring, and administrative tasks. Mastery of these commands can significantly enhance your productivity and system management capabilities. Keep practising these commands, explore more advanced options, and share your experiences to deepen your understanding and contribute to the community’s collective knowledge.

You May Also Be Interested In

References

Refer to the official Ubuntu documentation for a comprehensive view and updates on Ubuntu commands.

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.