Ubuntu Terminal Commands for Beginners
The Linux terminal is a powerful tool that allows you to interact with your Ubuntu system directly using text-based commands. This guide provides a straightforward overview of essential Ubuntu terminal commands, covering system navigation, file management, and system administration, designed to help you navigate and control your operating system efficiently.
To explore an extensive database of commands 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.
Navigating the File System
To move around your system, you need to know where you are and how to change directories.
pwd(Print Working Directory): Displays the absolute path of the directory you are currently in.ls(List): Shows the files and folders inside 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 Documentstakes you to the Documents folder, whilecd ..moves you up one level.
Managing Files and Directories
Creating, copying, and deleting files are fundamental tasks that can be done quickly through the command line.
mkdir(Make Directory): Creates a new folder. Syntax:mkdir folder_name.touch: Creates a new, empty file. Syntax:touch file_name.txt.cp(Copy): Copies files or directories. Syntax:cp source_file destination. Add the-rflag to copy folders.mv(Move): Moves files or folders to a new location. It is also used to rename files. Syntax:mv old_name new_name.rm(Remove): Deletes files. Userm -r folder_nameto delete directories and their contents. Note: Terminal deletions are permanent and do not go to the Trash.
System Administration and Package Management
Ubuntu uses the Advanced Package Tool (APT) to manage software
installations, updates, and system maintenance. These commands usually
require administrative privileges, which are granted using the
sudo prefix.
sudo(Superuser Do): Allows you to run commands with administrative privileges. It will prompt you for your user password.sudo apt update: Refreshes the local package index so your system knows what software updates are available.sudo apt upgrade: Installs the available upgrades for all packages currently installed on your system.sudo apt install package_name: Downloads and installs a specified software package.df -h(Disk Free): Displays the amount of available disk space on your file systems in a human-readable format.