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.
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:
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 (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:
| Command | What It Does | Example |
|---|---|---|
| pwd | Shows your current folder location | pwd → /home/username/documents |
| ls | Lists files and folders | ls or ls -la (with details) |
| cd | Changes to a different folder | cd documents |
| mkdir | Creates a new folder | mkdir new_folder |
| touch | Creates an empty file | touch myfile.txt |
| cp | Copies a file | cp file1.txt file2.txt |
| mv | Moves or renames a file | mv oldname.txt newname.txt |
| rm | Deletes a file | rm unwanted.txt |
| cat | Displays file contents | cat myfile.txt |
| man | Shows the manual for any command | man ls |
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:
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.
A path is the address of a file or folder. Linux uses forward slashes (/) to separate folder levels.
Two types of paths matter:
Shortcuts you'll use constantly:
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:
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.
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.
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.
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:
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.
