Linux Command Basics: A Practical Guide for Getting Started 🖥️

If you're new to Linux or haven't used the command line before, the prospect of typing commands instead of clicking buttons can feel intimidating. But Linux commands are simply instructions you give to your computer—and once you understand how they work, you'll find them faster and more powerful than graphical menus. This guide walks you through what commands are, how to use them safely, and the foundational concepts that make the command line work.

What Is a Linux Command?

A command is a text instruction that tells your Linux system to perform a specific task. When you open a terminal and type a command, you're communicating directly with your operating system's core—no graphical interface in between.

Commands typically follow a simple structure:

For example:

  • ls lists files in a folder
  • mkdir documents creates a new folder called "documents"
  • cp file1.txt file2.txt makes a copy of a file

The command itself (like ls) is the action. Options (often starting with - or --) modify how the command behaves. Arguments are the targets—the file, folder, or value the command works on.

The Terminal: Your Gateway to Commands đź’»

The terminal (also called a shell or command line) is the program where you type commands. It's simply an interface that accepts text input and displays text output—nothing more.

When you open a terminal, you'll see a prompt (usually something like $ or #), which means the system is ready for your input. Type your command, press Enter, and the system executes it.

Key variables that affect your experience:

  • Which shell you're using (bash, zsh, fish) — most systems default to bash, but shells differ in features and behavior
  • Your user permissions — some commands require administrator (root) access
  • Your current location — commands often work on files in your current folder unless you specify a full path

Common Commands Every Beginner Should Know

CommandWhat It DoesExample
pwdShows your current folder locationpwd → /home/username/documents
lsLists files and foldersls or ls -la (with details)
cdChanges to a different foldercd documents
mkdirCreates a new foldermkdir new_folder
touchCreates an empty filetouch myfile.txt
cpCopies a filecp file1.txt file2.txt
mvMoves or renames a filemv oldname.txt newname.txt
rmDeletes a filerm unwanted.txt
catDisplays file contentscat myfile.txt
manShows the manual for any commandman ls

Options and Flags: Making Commands Work Your Way

Most commands accept options (also called flags) that change their behavior. Options begin with a single dash (-) for short form or double dashes (--) for long form.

For example:

  • ls shows files in a simple list
  • ls -l shows files with details (size, date, permissions)
  • ls -a shows all files, including hidden ones
  • ls -la combines both options

You can chain short options together or use multiple long options. The man command (short for "manual") shows you every option available for any command—it's your built-in help system.

Paths: How Linux Finds Files

A path is the address of a file or folder. Linux uses forward slashes (/) to separate folder levels.

Two types of paths matter:

  • Absolute paths start from the root of the entire system (/home/username/documents/file.txt)
  • Relative paths are relative to your current location (documents/file.txt when you're in /home/username)

Shortcuts you'll use constantly:

  • . means "current folder"
  • .. means "parent folder (one level up)"
  • ~ means "your home folder"

Permissions: Who Can Do What

Linux is built for multiple users. Permissions control who can read, write, or execute files—a security feature that prevents accidental or intentional damage.

When you list files with ls -l, you'll see something like drwxr-xr-x. This shows:

  • Owner permissions (what you can do)
  • Group permissions (what other users in your group can do)
  • Everyone else's permissions

As a beginner, know that some commands require root (administrator) privileges. When you need elevated access, you'll use sudo before your command—but use it carefully, as it bypasses safety restrictions.

Variables: Storing Information

A variable is a container that holds information your system or programs use. The most common is PATH, which tells Linux where to look for commands.

You don't need to manage most variables—they're set automatically. But knowing they exist helps you understand why commands work differently on different systems or accounts.

Safety First: Commands That Make Changes

Some commands are destructive. rm (remove) deletes files permanently—there's no undo. rmdir removes folders. Before running any command you don't fully understand, check its manual:

Many users add a safety layer by using options like rm -i, which prompts you to confirm each deletion.

Getting Help and Learning More

The most important command you'll learn is man:

This opens the manual page for any command, showing every option, example, and behavior. It's your reference library built into Linux.

You can also:

  • Type command --help for a quick summary
  • Use man -k keyword to search for commands related to a topic
  • Search online for tutorials and examples

Your Next Steps

Start by opening a terminal and experimenting with basic commands in a non-critical folder. Try pwd, ls, mkdir, and cd to move around. Use man when you're curious about options. The command line becomes intuitive faster than you might expect—it's just a different way of communicating with your computer, and repetition builds confidence.

Your learning path will depend on your goals (system administration, software development, general Linux use) and how much time you want to invest. But these foundational concepts apply across all uses.