Fundamentals 6 min read

Master the Linux Terminal: 8 Essential Commands and Prompt Basics

This guide introduces the Linux terminal as a productivity tool, explains the shell and prompt components, and walks through eight core file‑management commands (pwd, ls, cd, mkdir, touch, cp, mv, rm) plus essential shortcuts like Tab completion, command history, and interrupt keys.

Ubuntu
Ubuntu
Ubuntu
Master the Linux Terminal: 8 Essential Commands and Prompt Basics

1. What Is a Shell?

The black window you see is a Terminal (terminal emulator) , and the program that runs inside it is the Shell . The shell receives your commands, translates them for the operating system kernel, and returns the results.

Bash (Bourne Again SHell) : the default shell on Ubuntu, widely used.

Zsh : a more feature‑rich shell popular among developers (installation covered in later tutorials).

2. Opening the Terminal

Shortcut: Ctrl + Alt + T (keep this shortcut handy).

Or search for "Terminal" in the Activities menu.

3. Understanding the Prompt

After opening the terminal you will see a line such as:

user@hostname:~$
user

: the current logged‑in username. hostname: the computer’s host name. ~: the current directory, representing the home directory /home/user. $: indicates a regular user; # would indicate the super‑user (root), which should be used with caution.

4. Core Navigation Commands

In the terminal you navigate with commands instead of a mouse. First, understand two path concepts:

Absolute path : starts from /, e.g., /home/user/Downloads.

Relative path : starts from the current directory, e.g., Downloads or ../Documents.

pwd (Print Working Directory)

Shows the full path of the current directory.

pwd
# Output: /home/user

ls (List)

Lists files and folders in the current directory.

ls
ls -l   # detailed info (permissions, size, time)
ls -a   # show hidden files (those starting with .)

cd (Change Directory)

Changes the current directory.

cd Downloads          # enter Downloads
cd ..                 # go up one level
cd ~                  # return to home directory
cd /                  # go to the root directory

mkdir (Make Directory)

Creates a new folder.

mkdir Projects

touch

Creates an empty file.

touch readme.txt

cp (Copy)

Copies files or directories.

cp file.txt file_backup.txt
cp -r folder1 folder2   # -r for recursive copy of a directory

mv (Move)

Moves or renames files.

mv file.txt Documents/   # move
mv oldname.txt newname.txt   # rename

rm (Remove)

Deletes files. Note that Linux terminal deletions bypass the recycle bin.

rm file.txt
rm -rf foldername   # force delete a folder and its contents (use with care)

5. Practical Tips

Tab completion : type part of a command or path (e.g., cd Do) and press Tab to auto‑complete (e.g., cd Downloads/).

Arrow keys : press up/down to scroll through command history, avoiding re‑typing.

Ctrl + C : abort a running program that is stuck.

Ctrl + L or clear: clear the screen.

Check help before executing : use command --help or man command (e.g., man ls).

Quote paths with spaces : wrap them in quotes, e.g., cd "My Files", otherwise the shell splits the path.

Practice these commands repeatedly; you’ll find typing on the keyboard far faster than navigating with a mouse.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxShellCommand LineTerminalBasic Commands
Ubuntu
Written by

Ubuntu

Focused on Ubuntu/Linux tech sharing, offering the latest news, practical tools, beginner tutorials, and problem solutions. Connecting open-source enthusiasts to build a Linux learning community. Join our QQ group or channel for discussion!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.