Last time, I showed you how to read a man page for a command by typing man followed by the command. In lesson 2, I showed you how to list files in long format by typing ls followed by a hyphen and an option, like ls -l. Why does one command use a hyphen, and the other not?
It’s all in the difference between options and targets. Here’s how most commands are entered:
command -options target
The command is the thing you want to do, the option is how you want to do it, and the target is where you want to do it. Some commands need an option, some don’t. Some commands need a target, some don’t. But if you use them, the computer can only tell the difference between an option and a target based on that little hyphen. Imagine it wasn’t there, and you tried typing
Are you telling the computer to list all items, or list the folder named “a”? The hyphen is how the computer knows you are typing an option or a target. Options have a hyphen before them, targets don’t.