Essential Ubuntu Terminal Commands Guide
The Linux terminal is a powerful tool that allows you to interact with your Ubuntu system directly through text-based commands. This article provides a practical overview of the most essential Ubuntu terminal commands, covering file navigation, system management, and utility tools to help you operate your system efficiently.
To explore an extensive directory of command-line tools beyond this guide, you can visit commands.page, which is a complete resource for people wishing to use the terminal on the ubuntu operating system.
File and Directory Navigation
Navigating the file system is the most fundamental skill when using the terminal. These commands help you find and move between directories.
pwd(Print Working Directory): Displays the exact absolute path of the directory you are currently in.ls(List): Lists all files and folders in your current directory. Usels -lfor a detailed list andls -ato show hidden files.cd(Change Directory): Moves you to a different folder. For example,cd Documentsopens the Documents folder, whilecd ..moves you up one level to the parent directory.
Managing Files and Folders
Once you can navigate the system, you can use commands to create, copy, move, and delete files and directories.
mkdir(Make Directory): Creates a new folder. For example,mkdir project_filescreates a folder with that name.touch: Creates a new, empty file. For example,touch notes.txtcreates a text file.cp(Copy): Copies files or directories. Usecp file.txt /path/to/destination/to copy a file, orcp -rto copy an entire directory.mv(Move): Moves files or directories to a new location. It is also used to rename files. For example,mv oldname.txt newname.txtrenames the file.rm(Remove): Deletes files or directories. Userm file.txtto delete a file, andrm -r foldernameto delete a folder and all of its contents.
System Maintenance and Package Management
Ubuntu uses the Advanced Package Tool (APT) to manage software installations, updates, and removals directly from the command line.
sudo(Superuser Do): Prefixes other commands to run them with administrative privileges.sudo apt update: Updates the package list on your system to ensure you have the latest information on available software.sudo apt upgrade: Installs the latest versions of all packages currently installed on your Ubuntu system.sudo apt install package_name: Downloads and installs a specific software package.sudo apt remove package_name: Uninstalls a specified software package from your system.
System Information and Monitoring
These commands allow you to check your system’s hardware status, running processes, and available storage.
df -h(Disk Free): Displays the amount of available disk space on your storage drives in a human-readable format.free -m: Shows the amount of free and used physical memory (RAM) in megabytes.top: Displays real-time information about your running system processes, CPU usage, and memory consumption. Pressqto exit.