command line terminology: what are these parts of a command called?
Clash Royale CLAN TAG#URR8PPP
up vote
21
down vote
favorite
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.
command-line command parameter terminology
 |Â
show 1 more comment
up vote
21
down vote
favorite
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.
command-line command parameter terminology
1
Have you looked at theman
pages forgit
andfind
, in particular the synopsis section?
â fpmurphy1
Jan 14 at 1:55
4
Have you looked at the man pages for git and find So the question seems nothing to do withgit
orfind
rather general terminology for linux.
â Att Righ
Jan 14 at 2:02
According to the bash man page inA | B
,A | B
is a pipeline,A
andB
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.
â Att Righ
Jan 14 at 2:24
4
In the context ofgit checkout ...
,checkout
is a subcommand, and in the context ofsh -c ...
,-c
is an option.
â wjandrea
Jan 14 at 4:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15
 |Â
show 1 more comment
up vote
21
down vote
favorite
up vote
21
down vote
favorite
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.
command-line command parameter terminology
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.
command-line command parameter terminology
edited Jan 14 at 10:14
asked Jan 14 at 1:22
theonlygusti
21217
21217
1
Have you looked at theman
pages forgit
andfind
, in particular the synopsis section?
â fpmurphy1
Jan 14 at 1:55
4
Have you looked at the man pages for git and find So the question seems nothing to do withgit
orfind
rather general terminology for linux.
â Att Righ
Jan 14 at 2:02
According to the bash man page inA | B
,A | B
is a pipeline,A
andB
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.
â Att Righ
Jan 14 at 2:24
4
In the context ofgit checkout ...
,checkout
is a subcommand, and in the context ofsh -c ...
,-c
is an option.
â wjandrea
Jan 14 at 4:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15
 |Â
show 1 more comment
1
Have you looked at theman
pages forgit
andfind
, in particular the synopsis section?
â fpmurphy1
Jan 14 at 1:55
4
Have you looked at the man pages for git and find So the question seems nothing to do withgit
orfind
rather general terminology for linux.
â Att Righ
Jan 14 at 2:02
According to the bash man page inA | B
,A | B
is a pipeline,A
andB
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.
â Att Righ
Jan 14 at 2:24
4
In the context ofgit checkout ...
,checkout
is a subcommand, and in the context ofsh -c ...
,-c
is an option.
â wjandrea
Jan 14 at 4:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15
1
1
Have you looked at the
man
pages for git
and find
, in particular the synopsis section?â fpmurphy1
Jan 14 at 1:55
Have you looked at the
man
pages for git
and find
, in particular the synopsis section?â fpmurphy1
Jan 14 at 1:55
4
4
Have you looked at the man pages for git and find So the question seems nothing to do with
git
or find
rather general terminology for linux.â Att Righ
Jan 14 at 2:02
Have you looked at the man pages for git and find So the question seems nothing to do with
git
or find
rather general terminology for linux.â Att Righ
Jan 14 at 2:02
According to the bash man page in
A | B
, A | B
is a pipeline, A
and B
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.â Att Righ
Jan 14 at 2:24
According to the bash man page in
A | B
, A | B
is a pipeline, A
and B
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.â Att Righ
Jan 14 at 2:24
4
4
In the context of
git checkout ...
, checkout
is a subcommand, and in the context of sh -c ...
, -c
is an option.â wjandrea
Jan 14 at 4:15
In the context of
git checkout ...
, checkout
is a subcommand, and in the context of sh -c ...
, -c
is an option.â wjandrea
Jan 14 at 4:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
34
down vote
accepted
The common names for each part is as follows:
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
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:
word: A sequence of characters considered as a single unit by the shell. Also known as a token.
Generally: Arguments
- Command line.
The concatenation of two simple commands with a |
is a pipe sequence or pipeline:
âÂÂâÂÂ1â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂ2âÂÂâÂÂâ âÂÂâÂÂâÂÂ1âÂÂâÂÂâÂÂâ âÂÂ2âÂÂâÂÂ2âÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂ2â âÂÂ2âÂÂ
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' /
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Mind that there are redirection and variable assignments also:
âÂÂâÂÂâÂÂ5âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ2âÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂâÂÂ6âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ5âÂÂâÂÂ
<infile tee file1 file2 | LC_ALL=C cat >file
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Where (beside the numbers from above):
- redirection.
- Variable assignment.
- Simple command.
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.
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords liketime
,noglob
that can be used instead or in addition to!
here.
â Stéphane Chazelas
Jan 14 at 9:53
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up incat $file
, here I would say$file
is a token, but the value of file is the argument.
â Att Righ
Jan 14 at 20:44
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is calledargv
â Att Righ
Jan 15 at 13:03
 |Â
show 10 more comments
up vote
15
down vote
@isaac's answer above seems good.
I want to extend this with some sources.
I guess the POSIX standard might in some sense be considered canonical.
Other sources might be man bash
and man proc
.
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
POSIX suggests that:
- Is the command name (rather than the command, though even this document uses command in places)
Argument
Arguments
Command (thoughman proc
uses the command line)
It also has terminology for many more complicated commands.
I think command is pretty ambiguous so perhaps the term command name and command line are good for clarity.j
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygustiproc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.
â Att Righ
Jan 14 at 20:28
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
34
down vote
accepted
The common names for each part is as follows:
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
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:
word: A sequence of characters considered as a single unit by the shell. Also known as a token.
Generally: Arguments
- Command line.
The concatenation of two simple commands with a |
is a pipe sequence or pipeline:
âÂÂâÂÂ1â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂ2âÂÂâÂÂâ âÂÂâÂÂâÂÂ1âÂÂâÂÂâÂÂâ âÂÂ2âÂÂâÂÂ2âÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂ2â âÂÂ2âÂÂ
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' /
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Mind that there are redirection and variable assignments also:
âÂÂâÂÂâÂÂ5âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ2âÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂâÂÂ6âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ5âÂÂâÂÂ
<infile tee file1 file2 | LC_ALL=C cat >file
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Where (beside the numbers from above):
- redirection.
- Variable assignment.
- Simple command.
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.
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords liketime
,noglob
that can be used instead or in addition to!
here.
â Stéphane Chazelas
Jan 14 at 9:53
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up incat $file
, here I would say$file
is a token, but the value of file is the argument.
â Att Righ
Jan 14 at 20:44
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is calledargv
â Att Righ
Jan 15 at 13:03
 |Â
show 10 more comments
up vote
34
down vote
accepted
The common names for each part is as follows:
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
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:
word: A sequence of characters considered as a single unit by the shell. Also known as a token.
Generally: Arguments
- Command line.
The concatenation of two simple commands with a |
is a pipe sequence or pipeline:
âÂÂâÂÂ1â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂ2âÂÂâÂÂâ âÂÂâÂÂâÂÂ1âÂÂâÂÂâÂÂâ âÂÂ2âÂÂâÂÂ2âÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂ2â âÂÂ2âÂÂ
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' /
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Mind that there are redirection and variable assignments also:
âÂÂâÂÂâÂÂ5âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ2âÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂâÂÂ6âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ5âÂÂâÂÂ
<infile tee file1 file2 | LC_ALL=C cat >file
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Where (beside the numbers from above):
- redirection.
- Variable assignment.
- Simple command.
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.
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords liketime
,noglob
that can be used instead or in addition to!
here.
â Stéphane Chazelas
Jan 14 at 9:53
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up incat $file
, here I would say$file
is a token, but the value of file is the argument.
â Att Righ
Jan 14 at 20:44
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is calledargv
â Att Righ
Jan 15 at 13:03
 |Â
show 10 more comments
up vote
34
down vote
accepted
up vote
34
down vote
accepted
The common names for each part is as follows:
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
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:
word: A sequence of characters considered as a single unit by the shell. Also known as a token.
Generally: Arguments
- Command line.
The concatenation of two simple commands with a |
is a pipe sequence or pipeline:
âÂÂâÂÂ1â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂ2âÂÂâÂÂâ âÂÂâÂÂâÂÂ1âÂÂâÂÂâÂÂâ âÂÂ2âÂÂâÂÂ2âÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂ2â âÂÂ2âÂÂ
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' /
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Mind that there are redirection and variable assignments also:
âÂÂâÂÂâÂÂ5âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ2âÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂâÂÂ6âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ5âÂÂâÂÂ
<infile tee file1 file2 | LC_ALL=C cat >file
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Where (beside the numbers from above):
- redirection.
- Variable assignment.
- Simple command.
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.
The common names for each part is as follows:
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
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:
word: A sequence of characters considered as a single unit by the shell. Also known as a token.
Generally: Arguments
- Command line.
The concatenation of two simple commands with a |
is a pipe sequence or pipeline:
âÂÂâÂÂ1â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂ2âÂÂâÂÂâ âÂÂâÂÂâÂÂ1âÂÂâÂÂâÂÂâ âÂÂ2âÂÂâÂÂ2âÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂ2â âÂÂ2âÂÂ
find transcripts/?.? -name '*.txt' | parallel -- sh -c 'echo $1 $2' /
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Mind that there are redirection and variable assignments also:
âÂÂâÂÂâÂÂ5âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ2âÂÂâ âÂÂâÂÂ2âÂÂâ âÂÂâÂÂâÂÂâÂÂ6âÂÂâÂÂâ âÂÂ1â âÂÂâÂÂ5âÂÂâÂÂ
<infile tee file1 file2 | LC_ALL=C cat >file
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ7âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
Where (beside the numbers from above):
- redirection.
- Variable assignment.
- Simple command.
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.
edited Jan 14 at 16:47
answered Jan 14 at 2:12
Isaac
6,7711834
6,7711834
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords liketime
,noglob
that can be used instead or in addition to!
here.
â Stéphane Chazelas
Jan 14 at 9:53
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up incat $file
, here I would say$file
is a token, but the value of file is the argument.
â Att Righ
Jan 14 at 20:44
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is calledargv
â Att Righ
Jan 15 at 13:03
 |Â
show 10 more comments
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords liketime
,noglob
that can be used instead or in addition to!
here.
â Stéphane Chazelas
Jan 14 at 9:53
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up incat $file
, here I would say$file
is a token, but the value of file is the argument.
â Att Righ
Jan 14 at 20:44
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is calledargv
â Att Righ
Jan 15 at 13:03
2
2
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading
!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords like time
, noglob
that can be used instead or in addition to !
here.â Stéphane Chazelas
Jan 14 at 9:53
In POSIX terminology, what you call pipe is a pipe sequence or pipeline (though a pipeline can have an optional leading
!
to negate its status). pipe would rather refer to the IPC mechanism used by most shells to implement pipelines (pipelines don't have to use pipes, ksh93 uses socketpairs instead on some systems for instance). Some shells have more keywords like time
, noglob
that can be used instead or in addition to !
here.â Stéphane Chazelas
Jan 14 at 9:53
1
1
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up in
cat $file
, here I would say $file
is a token, but the value of file is the argument.â Att Righ
Jan 14 at 20:44
IMHO, these things are called arguments - nothing else so I think the word token in this context means "atomic unit of bash's grammar". Here the term token only exists in the context of shell command line, not in the context of the program executes. It would be a bit weird to say "these are the programs tokens" but perhaps less strange to say "the second token in the command line is $test". A distinction comes up in
cat $file
, here I would say $file
is a token, but the value of file is the argument.â Att Righ
Jan 14 at 20:44
1
1
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
@PeterCordes You are correct, <<<"â¦" is a redirection, not an argument. Though it is still a token of the line. Sorry for the confusion.
â Isaac
Jan 14 at 21:52
1
1
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
@TOOGAM Those are exactly opposite to the standard definitions. The things the caller provides are arguments; cf. âÂÂformal parameterâÂÂ, or this SO question.
â Michael Homer
Jan 15 at 5:30
1
1
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is called
argv
â Att Righ
Jan 15 at 13:03
@TOOGAM "What I see are parameters". Hmm I think you are right. According the POSIX spec: "The shell executes a function (see Function Definition Command), built-in (see Special Built-In Utilities), executable file, or script, giving the names of the arguments as positional parameters numbered 1 to n, and the name of the command (or in the case of a function within a script, the name of the script) as the positional parameter numbered 0 (see Command Search and Execution)." and I had been wrong all these years... Although in my defense it is called
argv
â Att Righ
Jan 15 at 13:03
 |Â
show 10 more comments
up vote
15
down vote
@isaac's answer above seems good.
I want to extend this with some sources.
I guess the POSIX standard might in some sense be considered canonical.
Other sources might be man bash
and man proc
.
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
POSIX suggests that:
- Is the command name (rather than the command, though even this document uses command in places)
Argument
Arguments
Command (thoughman proc
uses the command line)
It also has terminology for many more complicated commands.
I think command is pretty ambiguous so perhaps the term command name and command line are good for clarity.j
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygustiproc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.
â Att Righ
Jan 14 at 20:28
add a comment |Â
up vote
15
down vote
@isaac's answer above seems good.
I want to extend this with some sources.
I guess the POSIX standard might in some sense be considered canonical.
Other sources might be man bash
and man proc
.
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
POSIX suggests that:
- Is the command name (rather than the command, though even this document uses command in places)
Argument
Arguments
Command (thoughman proc
uses the command line)
It also has terminology for many more complicated commands.
I think command is pretty ambiguous so perhaps the term command name and command line are good for clarity.j
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygustiproc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.
â Att Righ
Jan 14 at 20:28
add a comment |Â
up vote
15
down vote
up vote
15
down vote
@isaac's answer above seems good.
I want to extend this with some sources.
I guess the POSIX standard might in some sense be considered canonical.
Other sources might be man bash
and man proc
.
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
POSIX suggests that:
- Is the command name (rather than the command, though even this document uses command in places)
Argument
Arguments
Command (thoughman proc
uses the command line)
It also has terminology for many more complicated commands.
I think command is pretty ambiguous so perhaps the term command name and command line are good for clarity.j
@isaac's answer above seems good.
I want to extend this with some sources.
I guess the POSIX standard might in some sense be considered canonical.
Other sources might be man bash
and man proc
.
âÂÂ1â âÂÂâÂÂâÂÂ2âÂÂâÂÂâÂÂâÂÂ
git checkout master
â âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ3âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ4âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
POSIX suggests that:
- Is the command name (rather than the command, though even this document uses command in places)
Argument
Arguments
Command (thoughman proc
uses the command line)
It also has terminology for many more complicated commands.
I think command is pretty ambiguous so perhaps the term command name and command line are good for clarity.j
edited Jan 14 at 2:42
answered Jan 14 at 2:34
Att Righ
574313
574313
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygustiproc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.
â Att Righ
Jan 14 at 20:28
add a comment |Â
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygustiproc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.
â Att Righ
Jan 14 at 20:28
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
What's proc? I've never heard of that.
â theonlygusti
Jan 14 at 10:18
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
@theonlygusti man7.org/linux/man-pages/man5/proc.5.html
â Moira
Jan 14 at 10:42
5
5
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
+1 I like this answer best. (In this specific context, 2 is a subcommand, but generally yes, an argument).
â kubanczyk
Jan 14 at 14:02
@theonlygusti
proc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.â Att Righ
Jan 14 at 20:28
@theonlygusti
proc
is a special purpose filesystem (collection of files) that provide information about the kernel's internal state. I believe it stands for processes (see also sysfs which provides information about things others than processes). The reason it is relevant is written by kernel developers, so may well reflect the language that they use which might be a little more formal.â Att Righ
Jan 14 at 20:28
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416945%2fcommand-line-terminology-what-are-these-parts-of-a-command-called%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Have you looked at the
man
pages forgit
andfind
, in particular the synopsis section?â fpmurphy1
Jan 14 at 1:55
4
Have you looked at the man pages for git and find So the question seems nothing to do with
git
orfind
rather general terminology for linux.â Att Righ
Jan 14 at 2:02
According to the bash man page in
A | B
,A | B
is a pipeline,A
andB
are commands (it's unfortunate that this has the same name as just the first world in a command). I might call the first argument an executable but I can't find a source that agrees with me.â Att Righ
Jan 14 at 2:24
4
In the context of
git checkout ...
,checkout
is a subcommand, and in the context ofsh -c ...
,-c
is an option.â wjandrea
Jan 14 at 4:15
@JoL thanks for pointing that out. You guessed right, I've edited that. It's because I re-wrote that section some 4 times as I tried to do it properly
â theonlygusti
Jan 14 at 10:15