At the command line I often use "simple" commands like
mv foo/bar baz/bar
but I don't know what to call all the parts of this:
┌1┐ ┌──2───┐
git checkout master
│ └──────3──────┘
└───────4─────────┘
I (think I) know that 1 is a command and 2's an argument, and I'd probably call 3 an argument list (is that correct?).
However, I don't know what to call 4.
How are more complex "commands" labelled?
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' {} {/}
I'd appreciate an answer that breaks down what to call 1,2,3,4 and what to call each part of e.g. this "command" above.
It would be great to learn also about other things that are unique/surprising that I haven't included here.
Best Answer
The common names for each part is as follows:
Command name (first word or token of command line that is not a redirection or variable assignment and after aliases have been expanded).
Token, word, or argument to the command. From man bash:
Generally: Arguments
Command line.
The concatenation of two simple commands with a
|
is a pipe sequence or pipeline:Mind that there are redirection and variable assignments also:
Where (beside the numbers from above):
This is not an exaustive list of all the element a command line could have. Such a list is too complex for this short answer.