What are the three parts of a Linux command?
A command is made of three parts: the program name, options that tweak how it behaves, and arguments that say what to act on.
* A command's three parts — the program, options that tweak behaviour, and arguments that say what to act on. *
Reading a command left to right, the shell takes the first word as the program and everything after as parameters. The convention (not a hard rule) is: words starting with - are options, everything else is an argument.
ls -l /home
│ │ └── Argument (what to act on)
│ └── Option (how to behave)
└── Command (which program)
| Part | Purpose | Example |
|---|---|---|
| Command | The program to run | ls, cp, mkdir |
| Options | Modify behaviour | -l (long), -a (all) |
| Arguments | Target/input | /home, file.txt |
Options come in two styles, and knowing why matters:
- Short
-l: a single letter, terse, made for fast typing. - Long
--all: a whole word, self-documenting, made for scripts you want to be readable later. - Combined
-lais shorthand for-l -a— short options can be bundled behind one dash.
Gotcha: order and spacing matter. -la works, but --all-l does not — only short options bundle. And many commands take an option's value as the next word, e.g. head -n 5 file where 5 belongs to -n, not to file.