Essential Ubuntu Terminal Commands
Navigating the Ubuntu operating system through the command-line interface can significantly boost your productivity and system control. This article provides a straightforward guide to the most essential, general-purpose Linux terminal commands in Ubuntu, covering file navigation, system management, and file manipulation to help you confidently use the command line.
For a comprehensive directory of command utilities and detailed syntax, 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
To work efficiently in the terminal, you must know how to move around the file system.
pwd(Print Working Directory): Displays the absolute path of the directory you are currently in.ls(List): Shows the files and folders in your current directory. Usels -lato see hidden files and detailed file permissions.cd(Change Directory): Navigates to a different folder. For example,cd Documentsmoves you into the Documents folder, whilecd ..moves you up one directory level.
File and Folder Management
These commands allow you to create, copy, move, and delete files and folders directly from the terminal.
mkdir(Make Directory): Creates a new folder. Syntax:mkdir folder_name.touch: Creates a new, empty file. Syntax:touch filename.txt.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 or renames files and directories. Syntax:mv old_name.txt new_name.txtto rename, ormv file.txt /path/to/destination/to move.rm(Remove): Deletes files or directories. Userm filename.txtto delete a file, andrm -r folder_nameto delete a folder and its contents. Note: This action is permanent.
System Administration and Package Management
Managing system updates and software installation in Ubuntu requires
administrative privileges, which are granted using the sudo
prefix.
sudo(Superuser Do): Runs a command with administrative/root 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.df -h(Disk Free): Displays available disk space on your system in a human-readable format.top: Shows real-time system resources, including CPU usage, memory usage, and active processes. Pressqto exit.