Ubuntu Linux Terminal Commands: Complete Guide for Dell PCs

Summary: Learn the most important Ubuntu Linux terminal commands for your Dell PC. Step-by-step guide covering files, software, network, users, and shortcuts.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

Terminal commands are instructions you can use in the Ubuntu terminal app to accomplish tasks on your computer. Whether you're new to Linux or just need a quick reference, this guide walks you through the most common and useful Ubuntu terminal commands, from managing files and software to checking your network and system information.


What Is the Ubuntu Terminal?

The Linux command line is a text interface to your computer. Often referred to as the shell, terminal, console, or prompt, it can give the appearance of being complex and confusing to use. But don't worry, it's simpler than it looks, and this guide will get you comfortable quickly.

The Ubuntu terminal, also known as the command-line interface or shell, is a text-based environment that allows you to interact with your computer's operating system. Unlike graphical user interfaces (GUIs) that rely on visual elements like windows, icons, and buttons, the terminal communicates through typed commands.


How to Open the Terminal on Ubuntu

There are two easy ways to open the terminal:

Option 1: Keyboard shortcut (fastest)

  1. Press Ctrl + Alt + T on your keyboard.

Option 2: Search from the Activities menu

  1. Click the Activities button in the upper-left corner of your screen.
  2. Type Terminal in the search bar.
  3. Click the Terminal app when it appears.
Note: If you plan to use the terminal a lot, memorizing Ctrl + Alt + T to launch it and Ctrl + D to close it will soon make it feel like a handy assistant you can call on instantly, and dismiss just as easily.

Understanding the Terminal Prompt

When you open the terminal, you'll see a blinking cursor next to some text. When you type a command, it appears on the same line as this text. That text is there to tell you the computer is ready to accept a command, it's the computer's way of prompting you. In fact, it's usually referred to as the prompt.

When you run a command, any output it produces will usually be printed directly in the terminal, then you'll be shown another prompt once it's finished. Some commands can output a lot of text; others will operate silently and won't output anything at all. Don't be alarmed if you run a command and another prompt immediately appears, that usually means the command succeeded.


Section 1: Navigating the File System

These commands help you move around folders (called directories in Linux) and understand where you are.

 

Command What It Does Example
pwd Shows your current folder location pwd
ls Lists files and folders in the current directory ls
ls -l Lists files with details like permissions, size, and date ls -l
ls -a Shows all files, including hidden ones ls -a
cd foldername Changes to a specific folder cd Documents
cd .. Goes back one folder level cd ..
cd ~ Goes directly to your home folder cd ~

 

The pwd command displays the path of the current directory (folder) you're in. When you first open the terminal, you're in your home directory by default.

The ls command displays files and directories within a specified location. Common options include -a (shows hidden files, including those starting with a dot) and -l (displays a detailed list with permissions, ownership, size, and timestamps).


Section 2: Managing Files and Folders

These commands directly affect the files and text stored and used on your computer.

 

Command What It Does Example
mkdir foldername Creates a new folder mkdir MyProject
touch filename Creates a new empty file touch notes.txt
cp source destination Copies a file to a new location cp notes.txt ~/Documents/
mv source destination Moves or renames a file mv notes.txt renamed.txt
rm filename Deletes a file rm oldfile.txt
rm -r foldername Deletes a folder and everything inside it rm -r OldFolder
cat filename Displays the contents of a file cat notes.txt
nano filename Opens a file for editing in a simple text editor nano notes.txt
grep "text" filename Searches for specific text inside a file grep "error" log.txt

 

Warning: The rm command permanently deletes files. There is no recycle bin in the terminal. Always check before you run it.

The rm command is used to delete files. One significant aspect of Unix-like systems (including Ubuntu) is their file permission system.

The cat command displays, combines, or creates files by reading and writing file content. Common options include -n (displays line numbers alongside file content) and -b (displays line numbers for non-empty lines only).

The grep command searches for specific patterns or keywords within files or command output. Common options include -i (performs a case-insensitive search), -r (searches recursively through directories), and -n (displays line numbers with matching results).


Section 3: Installing and Managing Software

As a Debian-based Linux distribution, Ubuntu uses the APT package manager to install, update, and remove software packages via the command line.

Ubuntu includes both apt and apt-get. They use the same package database but are aimed at different jobs. apt is the better interactive tool for terminal sessions because its output is designed for humans. apt-get is the safer default for scripts because its command-line behavior is more stable across APT releases.

 

Command What It Does
sudo apt update Refreshes the list of available software packages
sudo apt upgrade Installs available updates for all installed packages
sudo apt install packagename Installs a specific software package
sudo apt remove packagename Removes a software package
sudo apt autoremove Removes packages that are no longer needed

 

To update your system, follow these steps:

  1. Open the terminal using Ctrl + Alt + T.
  2. Type the following command and press Enter to refresh the package list: sudo apt update
  3. Enter your password when prompted, then press Enter.
  4. Type the following command and press Enter to install available updates: sudo apt upgrade
  5. When asked to confirm, type Y and press Enter.
Note: apt update fetches the latest package lists from the configured repositories. This does not upgrade any packages, it only updates the information about what packages are available.

To install a specific application:

  1. Open the terminal.
  2. Type the following command, replacing packagename with the app you want to install: sudo apt install packagename Example: To install the VLC media player, type: sudo apt install vlc
  3. Press Enter, type Y when prompted, and press Enter again.

Section 4: Checking System Information

Use these commands to find out details about your Dell PC's hardware and software.

 

Command What It Does
uname -a Shows the kernel version and system architecture
lsb_release -a Shows your Ubuntu version
df -h Shows disk usage for all drives (human-readable)
free -h Shows how much RAM is available
top Shows real-time CPU and memory usage
htop Shows an improved, interactive view of running processes
uptime Shows how long the system has been running
date Displays the current date and time
whoami Shows which user you're currently logged in as
hostname Shows your computer's name on the network

 

The uname command prints system information such as kernel version and architecture. Use uname -a to display all available system information at once.

The top command displays real-time information about system activity. It displays dynamic information about system processes.

Before upgrading Ubuntu to a new release, it's essential to prepare your system. Check disk space to ensure you have enough free space to download and install upgraded packages. You can check the disk space using the df -h command.


Section 5: Managing Users and Groups

User management is a critical part of maintaining a secure system. Ineffective user and privilege management often leads to a system being compromised.

 

Command What It Does
whoami Shows the current logged-in user
sudo adduser username Creates a new user account
sudo deluser username Removes a user account
passwd Changes your password
sudo passwd username Changes another user's password
sudo usermod -aG groupname username Adds a user to a group
groups username Shows which groups a user belongs to
id Shows the current user's ID and group memberships

 

adduser is a high-level, user-friendly script that simplifies the process of creating a new user account. It interactively prompts for information, automatically creates a home directory, copies skeleton files (like .bashrc and .profile), sets appropriate permissions, and assigns a default shell. In most cases, it's the recommended command for creating users on Debian-based systems like Ubuntu.

To add a new user, follow these steps:

  1. Open the terminal.
  2. Type the following command, replacing username with the new user's name: sudo adduser username
  3. Press Enter and follow the on-screen prompts to set a password and fill in optional details.

To give a user admin (sudo) access:

The easiest way to grant sudo privileges in Ubuntu is to add the user to the sudo group. Members of this group can execute any command as root and are prompted for their password when using sudo.

  1. Open the terminal.
  2. Type the following command, replacing username with the user's name: sudo usermod -aG sudo username
  3. Press Enter. The changes take effect the next time the user logs in.
Note: Always use the visudo command to edit the sudoers file. This command validates the syntax before saving, preventing errors that could lock you out of sudo access entirely.

Section 6: Managing File Permissions

Every file and directory has a set of permissions that determine who can read, write, or execute it.

 

Symbol Meaning
r Read
w Write
x Execute



Command What It Does Example
ls -l Views permissions for files in a folder ls -l
chmod 755 filename Sets read/write/execute for owner; read/execute for others chmod 755 script.sh
chmod 644 filename Sets read/write for owner; read-only for others chmod 644 file.txt
chown user:group filename Changes the owner and group of a file chown john:staff file.txt

 

A strong permission strategy is built on the Principle of Least Privilege (PoLP), meaning users and processes should only have the minimum necessary access to perform their intended functions.


Section 7: Network Commands

Use these commands to check your network connection, find your IP address, and troubleshoot connectivity.

 

Command What It Does
ip addr or ip a Shows your IP address and network interfaces
ping google.com Tests your internet connection
ping -c 4 google.com Sends exactly 4 ping packets and stops
wget URL Downloads a file from the internet
curl URL Transfers data to or from a server
hostname -I Displays your local IP address
ss -tlnp Lists open network ports

 

Note: The ifconfig command is deprecated and has been replaced by the ip command in most modern Linux distributions. It is part of the net-tools package, which may not be installed by default on newer systems. We recommend using ip addr instead.

The ip command is one of the most basic and helpful network commands in Linux. It typically displays the status of network interfaces and IP addresses assigned to your system. It succeeds the older ifconfig command, which is now deprecated.

Ping is a simple but powerful network tool that helps you check the connectivity between your computer and a remote host (such as a website, server, or another computer). It sends small data packets called "echo requests" to the target host, which then responds with "echo replies." A successful ping shows that there is a connection to the destination.

Note: Unlike Windows, where ping stops after 4 tries, Linux ping runs forever until you stop it. Stop it by pressing Ctrl + C.

To check if your internet connection is working:

  1. Open the terminal.
  2. Type the following command and press Enter: ping -c 4 google.com
  3. If you see replies, your connection is working. If you see errors, check your network settings.

The curl and wget commands in Linux are both used for downloading files from the internet via the command line. These commands offer a convenient way to fetch files, web pages, or other resources directly from a specified URL.


Section 8: Process Management

These commands help you see what's running on your Dell PC and stop anything that isn't responding.

 

Command What It Does
ps aux Lists all running processes
top Shows live system resource usage
kill PID Stops a process by its ID number
killall processname Stops all processes with a given name
Ctrl + C Stops the currently running terminal command

 

Process management commands such as ps, kill, killall, and top are essential for monitoring system health and terminating unresponsive processes.

To stop an unresponsive program:

  1. Open the terminal.
  2. Type the following command and press Enter to find the program's process ID (PID): ps aux | grep programname
  3. Note the PID number in the second column.
  4. Type the following command, replacing PID with the actual number, and press Enter: kill PID

Section 9: Helpful Terminal Shortcuts

These keyboard shortcuts save time and make your terminal experience much smoother.

 

Shortcut What It Does
Ctrl + Alt + T Opens a new terminal window
Ctrl + C Stops the current command
Ctrl + Z Pauses (suspends) the current command
Ctrl + D Closes the terminal session
Ctrl + L Clears the terminal screen
Tab Auto-completes a command or filename
Up/Down arrow keys Scrolls through previous commands
Ctrl + R Searches your command history
Ctrl + A Moves the cursor to the beginning of the line
Ctrl + E Moves the cursor to the end of the line
Ctrl + U Clears the current line

 

Mastering shortcuts like Ctrl + R for reverse command search, Ctrl + A/Ctrl + E for moving to the start/end of the line, and tab completion for commands and filenames can save precious time.

Note: You can use Tab to auto-fill commands in the terminal. For example, just type cd Doc and then press Tab, and the terminal fills in the rest to make it cd Documents.

Section 10: Getting Help in the Terminal

You don't need to memorize every command. Ubuntu has built-in help tools.

 

Command What It Does
man commandname Opens the manual (full documentation) for any command
commandname --help Shows a quick summary of command options
whatis commandname Gives a one-line description of a command

 

Example: To learn more about the ls command, type:

man ls

Press Q to exit the manual.


Troubleshooting Common Issues

"Command not found" error

This usually means one of the following:

  • The package is not installed. Install it using: sudo apt install packagename.
  • Linux is case-sensitive, so LS and ls are treated as different commands. Verify spelling and capitalization.

"Permission denied" error

This error indicates that your user account lacks the required permissions to run a command or access a file. Run the command with elevated privileges using sudo, or modify file permissions with chmod if needed.

Network not reachable

  1. Run ip addr to check that your network interface is active.
  2. If ping works with an IP address but fails with a domain name, the issue is DNS. Run dig domain to check whether your configured DNS server returns an answer. If the ANSWER SECTION is empty, try a different resolver using dig @8.8.8.8 domain.

Quick Reference: Most Used Ubuntu Terminal Commands

Category Command What It Does
Navigation pwd Shows current location
Navigation ls Lists files
Navigation cd foldername Changes folder
Files cp, mv, rm Copy, move, delete files
Software sudo apt update Refreshes package list
Software sudo apt install Installs software
System Info df -h Checks disk space
System Info free -h Checks RAM
Network ip addr Shows IP address
Network ping Tests connection
Users sudo adduser Creates a new user
Help man commandname Opens command manual

Frequently Asked Questions (FAQs)

Q: What is the Ubuntu terminal used for?
The Ubuntu terminal is a text-based tool that lets you install software, manage files, check your network, control users, and much more, often faster than using a graphical interface.

Q: How do I open the terminal on Ubuntu?
Press Ctrl + Alt + T on your keyboard. This works on most Ubuntu versions, including Ubuntu 22.04 and 24.04.

Q: What is sudo in Ubuntu?
sudo (SuperUser DO) allows you to run programs or other commands with administrative privileges, just like "Run as administrator" in Windows.

Q: How do I stop a command that is running in the terminal?
Press Ctrl + C to stop a running command at any time.

Q: How do I update Ubuntu from the terminal?
Run sudo apt update to refresh the package list, then run sudo apt upgrade to install all available updates.

Q: Is ifconfig still available in Ubuntu?
ifconfig is part of the net-tools package. If you need it on a modern Ubuntu system, install it with sudo apt install net-tools. However, the preferred modern command is ip addr.

Q: How do I check my Ubuntu version from the terminal?
Type lsb_release -a and press Enter. This shows your Ubuntu version and codename.

Affected Products

Inspiron, Latitude, Vostro, XPS, Fixed Workstations
Article Properties
Article Number: 000123980
Article Type: How To
Last Modified: 25 May 2026
Version:  8
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.