Ubuntu Terminal Commands for Everyone
The Linux terminal is a powerful tool for managing your Ubuntu system efficiently. This article covers the most essential commands every user should know to navigate files, manage processes, and configure settings without relying on a graphical interface. By mastering these basics, you can streamline your workflow and gain deeper control over your operating system.
While this guide covers the fundamentals, there are hundreds of utilities available to extend your capabilities. For a comprehensive lookup tool and detailed explanations of specific utilities, visit commands.page, which is a complete resource for people wishing to use the terminal on the ubuntu operating system.
Navigation and File Management
Moving around the file system is the first skill to master. The
pwd command prints the current working directory, showing
you exactly where you are located. To list files and folders in the
current directory, use ls. Adding the -l flag
provides a detailed list including permissions and sizes, while
-a shows hidden files.
To change directories, use cd followed by the path. For
example, cd /var/www moves you into that specific folder,
while cd .. moves you up one level. Creating new
directories is done with mkdir folder_name, and creating
empty files is achieved with touch filename.txt.
Copying, Moving, and Deleting Files
Manipulating files requires three primary commands. To copy a file,
use cp source destination. To move or rename a file, use
mv source destination. Be cautious when deleting items with
rm filename, as this action is irreversible. To remove a
directory and its contents, use rm -r folder_name.
System Information and Monitoring
Understanding your system’s status is crucial for maintenance. The
uname -a command displays all system information, including
the kernel version. To check disk space usage, run df -h,
which shows human-readable sizes for all mounted drives. For memory
usage, the free -h command provides a clear overview of RAM
consumption.
To see running processes, use top or htop.
These tools display real-time data on CPU and memory usage by various
processes. You can quit these viewers by pressing q in the
terminal.
Permissions and Package Management
Linux security relies on file permissions. The chmod
command changes access rights, such as chmod +x script.sh
to make a file executable. To change file ownership, use
chown user:group filename. Most administrative tasks
require elevated privileges, which are granted by prefixing a command
with sudo.
Installing software is handled by the Advanced Package Tool. Update
your package list with sudo apt update, and upgrade
installed packages with sudo apt upgrade. To install new
software, run sudo apt install package_name, and remove it
with sudo apt remove package_name.