Navigate and master Ubuntu with our essential commands cheat sheet, perfect for users of all levels.
Ubuntu Cheat Sheet Commands
The Ubuntu Commands Cheat Sheet provides a list of the most crucial Ubuntu commands that every user should be familiar with. These commands help you navigate the system, manage files and directories, install and update software, and perform many other tasks. Whether you’re new to Ubuntu or have been using it for a while, this cheat sheet will be a handy guide.
This comprehensive guide is designed to help you navigate the Ubuntu operating system with ease. Covering everything from basic file management to advanced networking tasks, our cheat sheet includes essential commands to boost your efficiency and productivity. Network engineers and system administrators rely on these commands for their daily tasks and critical operations. Dive in and start mastering Ubuntu today!
Displays all system information Shows current hostname and related details Lists CPU architecture information Shows system time
top
htop
df -h
free -m
kill <process id>
Displays real-time system processes An interactive process viewer (needs installation) Shows disk usage in a human-readable format Displays free and used memory in MB Terminates a process
Running Commands
Directory Navigation
[command] &
jobs
fg <command number>
Runs command in the background Displays background commands Brings command to the foreground
pwd
cd <directory>
mkdir <dirname>
Displays the current directory path Changes the current directory Creates a new directory
Service Management
Text Editing and Processing
sudo systemctl start <service>
sudo systemctl stop <service>
sudo systemctl status <service>
sudo systemctl reload <service>
journalctl -f
journalctl -u <unit_name>
Starts a service Stops a service Checks the status of a service Reloads a service’s configuration Follows the journal, showing new log messages in real time Displays logs for a specific systemd unit.
nano [file]
cat <file>
less <file>
head <file>
tail <file>
awk {print} [file]
Opens a file in the Nano text editor Displays the contents of a file Displays the paginated content of a file Shows the first few lines of a file Shows the last few lines of a file Prints every line in a file
Cron jobs and scheduling
Archiving and Compression
crontab -e
crontab -l
Edits cron jobs for the current user Lists cron jobs for the current user
tar -czvf <name.tar.gz> [files]
tar -xvf <name.tar.[gz|bz|xz]>
Compresses files into a tar.gz archive Extracts a compressed tar archive
File Management
Searching and Finding
ls
touch <filename>
cp <source> <destination>
mv <source> <destination>
rm <filename>
Lists files and directories Creates an empty file or updates the last accessed date Copies files from source to destination Moves files or renames them Deletes a file
grep <search_pattern> <file>
find [directory] -name <search_pattern>
Compresses files into a tar.gz archive Extracts a compressed tar archive
APT Package Management
SNAP Package Management
sudo apt install <package>
apt search <package>
apt-cache policy <package>
sudo apt update
sudo apt upgrade
sudo apt remove <package>
sudo apt purge <package'>
Installs a package Searches for APT packages Lists available package versions Updates package lists Upgrades all upgradable packages Removes a package Removes a package and all its configuration files
snap find
sudo snap install <snap_name>
sudo snap remove <snap_name>
sudo snap refresh
snap list
snap info <snap_name>
Search for Snap packages Installs a Snap package Removes a Snap package Updates all installed Snap packages Lists all installed Snap packages Displays information about a Snap package
User Management
Group Management
w
sudo adduser <username>
sudo deluser <username>
sudo passwd <username>
su <username>
sudo passwd -l <username>
sudo passwd -u <username>
sudo change <username>
Shows which users are logged in Creates a new user Deletes a user Sets or changes the password for a user Switches user Locks a user account Unlocks a user password Sets user password expiration date
id [username]
groups [username]
sudo addgroup <groupname>
sudo delgroup <groupname>
Displays user and group IDs Shows the groups a user belongs to Creates a new group Deletes a group
Networking
Netplan configuration
ip addr show
ip -s link
ss -l
ping <'host'>
Displays network interfaces and IP addresses Shows network statistics Shows listening sockets Pings a host and outputs results
cat /etc/netplan/*.yaml
sudo netplan try
sudo netplan apply
Displays the current Netplan configuration Tests a new configuration for a set period of time Applies the current Netplan configuration
Firewall management
SSH and remote access
sudo ufw status
sudo ufw enable
sudo ufw disable
sudo ufw allow <port/service>
sudo ufw deny <port/service>
sudo ufw delete allow/deny -|-
Displays the status of the firewall Enables the firewall Disables the firewall Allows traffic on a specific port or service Denies traffic on a specific port or service Deletes an existing rule
ssh <user@host>
scp <user@host>:<destination>
Connects to a remote host via SSH Securely copies files between hosts
What is Ubuntu?
Ubuntu is a popular, open-source operating system based on Linux, known for its ease of use and robust security features. It is widely used by developers globally due to its stability and versatility. Ubuntu provides a user-friendly interface and a vast repository of software applications, making it suitable for both beginners and experienced users. Regular updates and strong community support ensure that Ubuntu remains a reliable and cutting-edge choice for desktops, servers, and cloud environments. Whether for personal use or enterprise solutions, Ubuntu offers a powerful platform for a wide range of computing needs.
Useful Ubuntu Shortcuts
Here are some useful shortcuts for Ubuntu that can help network engineers and system administrators perform their tasks more efficiently. These shortcuts enable quick navigation and command execution in the terminal. By using them, you can streamline your workflow, save time, and focus on more critical tasks. From searching command history to managing multiple terminal tabs, these shortcuts cover essential functions, making everyday tasks faster and less cumbersome. Incorporating these into your routine will enhance your productivity and make your command-line experience smoother, especially when performing configuration, monitoring, and maintenance activities on Ubuntu systems.
Search Command History:Ctrl + R
Cancel Current Command:Ctrl + C
Clear Terminal Screen:Ctrl + L
Exit Terminal:Ctrl + D or type exit
Pause a Command:Ctrl + Z (resume with fg)
Open a New Terminal Tab:Ctrl + Shift + T
Switch Between Terminal Tabs:Ctrl + PgUp/PgDn
Autocomplete Commands or Filenames:Tab
Jump to Beginning of the Line:Ctrl + A
Jump to End of the Line:Ctrl + E
Delete Entire Line:Ctrl + U
Delete from Cursor to End of Line:Ctrl + K
Delete Word Before Cursor:Ctrl + W
Undo Last Command:Ctrl + _ or Ctrl + Shift + -
These shortcuts will help you navigate and manage your Ubuntu system more effectively, making your workflow smoother and more efficient.
GNS3 Knowledge Base
Discover a wealth of information and expert tips in our GNS3 Knowledge Base, your go-to resource for mastering network simulations. Whether you need detailed tutorials, expert tips, or troubleshooting advice, our Knowledge Base has everything to enhance your skills and solve any challenges. Dive in now to enhance your skills and troubleshoot any challenges with ease!
Share the Knowledge: Spread the Word About Our Ubuntu Cheat Sheet!
If you find this page helpful for your networking knowledge and skills, please consider sharing it with your friends, colleagues, and social media followers. Your support helps us create more valuable resources and enhance our courses.
You can share this page on your social media accounts like Facebook, LinkedIn, Twitter, and any related networking and programming forums or blogs. By sharing, you assist other networking enthusiasts in their learning journey, making their work easier and more efficient. So, if you’d like to help others, kindly share this page.
Ubuntu® is a trademark of Canonical Ltd. More information about Ubuntu trademark usage guidelines is available at ubuntu.com. This document is intended for educational purposes only and is not affiliated with Canonical Ltd.
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.