H
H
Holfamer2014-12-21 16:33:35
Command line
Holfamer, 2014-12-21 16:33:35

What are "-" (one dash) and "--" (double dash) used for in the unix shell?

Explain in plain language what is "-" (one dash) and "--" (double dash) in commands? What's the difference between them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Lerg, 2014-12-21
@holfamer

There is a rule: if the parameter is one-letter, then a single dash is used, and if it is longer (a word), then a double dash is used. But this rule is not observed everywhere.
In some commands, a double dash means stop processing input parameters.
Another single dash usually serves as an indicator that standard input (stdin) is being used instead of a file.
But at the same time, this cd -is a transition to the previous directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question