What does command line arguments mean in pstree -a option
When read the manual of pstree
-a Show command line arguments. If the command line of a process is swapped out, that process is
shown in parentheses. -a implicitly disables compaction for processes but not threads.
I am very confused about 'command line arguments'
Compare the output
me@alpha:~$ pstree |head -5
systemd-+-ModemManager---2*[{ModemManager}]
|-NetworkManager-+-dhclient
| `-2*[{NetworkManager}]
|-accounts-daemon---2*[{accounts-daemon}]
|-acpid
me@alpha:~$ pstree -a | head -5
systemd splash
|-ModemManager --filter-policy=strict
| `-2*[{ModemManager}]
|-NetworkManager --no-daemon
| |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...
Command lines are composed of function, options and arguments
Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.
What does the command line arguments mean here?
bash
add a comment |
When read the manual of pstree
-a Show command line arguments. If the command line of a process is swapped out, that process is
shown in parentheses. -a implicitly disables compaction for processes but not threads.
I am very confused about 'command line arguments'
Compare the output
me@alpha:~$ pstree |head -5
systemd-+-ModemManager---2*[{ModemManager}]
|-NetworkManager-+-dhclient
| `-2*[{NetworkManager}]
|-accounts-daemon---2*[{accounts-daemon}]
|-acpid
me@alpha:~$ pstree -a | head -5
systemd splash
|-ModemManager --filter-policy=strict
| `-2*[{ModemManager}]
|-NetworkManager --no-daemon
| |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...
Command lines are composed of function, options and arguments
Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.
What does the command line arguments mean here?
bash
add a comment |
When read the manual of pstree
-a Show command line arguments. If the command line of a process is swapped out, that process is
shown in parentheses. -a implicitly disables compaction for processes but not threads.
I am very confused about 'command line arguments'
Compare the output
me@alpha:~$ pstree |head -5
systemd-+-ModemManager---2*[{ModemManager}]
|-NetworkManager-+-dhclient
| `-2*[{NetworkManager}]
|-accounts-daemon---2*[{accounts-daemon}]
|-acpid
me@alpha:~$ pstree -a | head -5
systemd splash
|-ModemManager --filter-policy=strict
| `-2*[{ModemManager}]
|-NetworkManager --no-daemon
| |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...
Command lines are composed of function, options and arguments
Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.
What does the command line arguments mean here?
bash
When read the manual of pstree
-a Show command line arguments. If the command line of a process is swapped out, that process is
shown in parentheses. -a implicitly disables compaction for processes but not threads.
I am very confused about 'command line arguments'
Compare the output
me@alpha:~$ pstree |head -5
systemd-+-ModemManager---2*[{ModemManager}]
|-NetworkManager-+-dhclient
| `-2*[{NetworkManager}]
|-accounts-daemon---2*[{accounts-daemon}]
|-acpid
me@alpha:~$ pstree -a | head -5
systemd splash
|-ModemManager --filter-policy=strict
| `-2*[{ModemManager}]
|-NetworkManager --no-daemon
| |-dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf...
Command lines are composed of function, options and arguments
Say -a show command line arguments, implies that others just show funtions and options, but that is not the case.
What does the command line arguments mean here?
bash
bash
asked Jan 22 at 4:28
AliceAlice
415110
415110
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5
, there is one argument to head
which is -5
.
In the pstree
output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient
and 2 NetworkManager
threads.
Adding the -a
flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager
was started with one argument --no-daemon
, and likewise dhclient
was started with several arguments.
That is all the man page means by "show command line arguments".
add a comment |
The arguments are everything that isn't the command name itself. For example, in
dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
the arguments are all of
-d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
These are the values at positions 1 and onwards in the C argv
array given to the program when it starts, or in sys.argv[1..]
in Python.
What the pstree
manual is implying is that without -a
it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager
is listed in the first version without -a
, but ModemManager --filter-policy=strict
in the -a
version. It doesn't care whether the "arguments" started with -
or what they represented.
Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree
has to show every program, it can't know how they all think about their command lines and has to be very generic.
In essence the structure of a command line is
command-name argument-1 argument-2 argument-3...
and those arguments could be -x
or a sub-command or a path name, and they're all the same until command-name
sees them and decides what to do. pstree
sees them all in a raw form and just reports them to you when you ask for them.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111838%2fwhat-does-command-line-arguments-mean-in-pstree-a-option%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5
, there is one argument to head
which is -5
.
In the pstree
output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient
and 2 NetworkManager
threads.
Adding the -a
flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager
was started with one argument --no-daemon
, and likewise dhclient
was started with several arguments.
That is all the man page means by "show command line arguments".
add a comment |
Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5
, there is one argument to head
which is -5
.
In the pstree
output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient
and 2 NetworkManager
threads.
Adding the -a
flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager
was started with one argument --no-daemon
, and likewise dhclient
was started with several arguments.
That is all the man page means by "show command line arguments".
add a comment |
Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5
, there is one argument to head
which is -5
.
In the pstree
output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient
and 2 NetworkManager
threads.
Adding the -a
flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager
was started with one argument --no-daemon
, and likewise dhclient
was started with several arguments.
That is all the man page means by "show command line arguments".
Command-line arguments, in general, refers to all arguments after the name of the program being run. For example, in your command pstree | head -5
, there is one argument to head
which is -5
.
In the pstree
output, the tree consists of a root of either a pid (process ID) or init, and then the tree of children threads. For example, in your output, NetworkManager is a parent process that is running one dhclient
and 2 NetworkManager
threads.
Adding the -a
flag also prints the arguments that were used when each process or thread was started. For example, in your output, we can see that NetworkManager
was started with one argument --no-daemon
, and likewise dhclient
was started with several arguments.
That is all the man page means by "show command line arguments".
answered Jan 22 at 4:46
rlhelinskirlhelinski
415
415
add a comment |
add a comment |
The arguments are everything that isn't the command name itself. For example, in
dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
the arguments are all of
-d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
These are the values at positions 1 and onwards in the C argv
array given to the program when it starts, or in sys.argv[1..]
in Python.
What the pstree
manual is implying is that without -a
it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager
is listed in the first version without -a
, but ModemManager --filter-policy=strict
in the -a
version. It doesn't care whether the "arguments" started with -
or what they represented.
Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree
has to show every program, it can't know how they all think about their command lines and has to be very generic.
In essence the structure of a command line is
command-name argument-1 argument-2 argument-3...
and those arguments could be -x
or a sub-command or a path name, and they're all the same until command-name
sees them and decides what to do. pstree
sees them all in a raw form and just reports them to you when you ask for them.
add a comment |
The arguments are everything that isn't the command name itself. For example, in
dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
the arguments are all of
-d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
These are the values at positions 1 and onwards in the C argv
array given to the program when it starts, or in sys.argv[1..]
in Python.
What the pstree
manual is implying is that without -a
it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager
is listed in the first version without -a
, but ModemManager --filter-policy=strict
in the -a
version. It doesn't care whether the "arguments" started with -
or what they represented.
Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree
has to show every program, it can't know how they all think about their command lines and has to be very generic.
In essence the structure of a command line is
command-name argument-1 argument-2 argument-3...
and those arguments could be -x
or a sub-command or a path name, and they're all the same until command-name
sees them and decides what to do. pstree
sees them all in a raw form and just reports them to you when you ask for them.
add a comment |
The arguments are everything that isn't the command name itself. For example, in
dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
the arguments are all of
-d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
These are the values at positions 1 and onwards in the C argv
array given to the program when it starts, or in sys.argv[1..]
in Python.
What the pstree
manual is implying is that without -a
it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager
is listed in the first version without -a
, but ModemManager --filter-policy=strict
in the -a
version. It doesn't care whether the "arguments" started with -
or what they represented.
Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree
has to show every program, it can't know how they all think about their command lines and has to be very generic.
In essence the structure of a command line is
command-name argument-1 argument-2 argument-3...
and those arguments could be -x
or a sub-command or a path name, and they're all the same until command-name
sees them and decides what to do. pstree
sees them all in a raw form and just reports them to you when you ask for them.
The arguments are everything that isn't the command name itself. For example, in
dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
the arguments are all of
-d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-wlp3s0.pid -lf
These are the values at positions 1 and onwards in the C argv
array given to the program when it starts, or in sys.argv[1..]
in Python.
What the pstree
manual is implying is that without -a
it only lists the name of each program and not any of the other pieces given on the command line. That is what your two examples show: just ModemManager
is listed in the first version without -a
, but ModemManager --filter-policy=strict
in the -a
version. It doesn't care whether the "arguments" started with -
or what they represented.
Sometimes programs distinguish "options" and "flags" and "arguments" and even "commands" in their documentation, but to the system they are all just arguments. The program gets given all of them together and gets to decide itself what to do with them, and which fit into each category. It can be useful to help a person think about what they're doing, but it's purely informative and not enforced. Since pstree
has to show every program, it can't know how they all think about their command lines and has to be very generic.
In essence the structure of a command line is
command-name argument-1 argument-2 argument-3...
and those arguments could be -x
or a sub-command or a path name, and they're all the same until command-name
sees them and decides what to do. pstree
sees them all in a raw form and just reports them to you when you ask for them.
answered Jan 22 at 4:46
Michael HomerMichael Homer
1575
1575
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111838%2fwhat-does-command-line-arguments-mean-in-pstree-a-option%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown