How do ` -f` and `-o` interact in `ps`?ps: output modifiers vs output format controlps: error: conflicting...
DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
What exactly is the parasitic white layer that forms after iron parts are treated with ammonia?
"which" command doesn't work / path of Safari?
How can I hide my bitcoin transactions to protect anonymity from others?
Do airline pilots ever risk not hearing communication directed to them specifically, from traffic controllers?
How to type dʒ symbol (IPA) on Mac?
declaring a variable twice in IIFE
Can I make popcorn with any corn?
Work Breakdown with Tikz
How can bays and straits be determined in a procedurally generated map?
Book about a traveler who helps planets in need
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).
Why are 150k or 200k jobs considered good when there are 300k+ births a month?
How long does it take to type this?
Is Social Media Science Fiction?
Is it possible to make sharp wind that can cut stuff from afar?
How does one intimidate enemies without having the capacity for violence?
Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)
Why CLRS example on residual networks does not follows its formula?
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
What would happen to a modern skyscraper if it rains micro blackholes?
If Manufacturer spice model and Datasheet give different values which should I use?
How do ` -f` and `-o` interact in `ps`?
ps: output modifiers vs output format controlps: error: conflicting format options-p and -o comm doesn't work together?How do I tell `ps` to use all available columns?How to find the PID of nginx processhow to print ps header when using pipe in linuxHow to determine which script is being executed by bash?How to group processes with the same nameps: format (separator and width)How long does my Java process run?How can I logically AND two selection conditions in ps?How can I use `--lines` `--row` modifiers in `ps` command
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
How do -f
and -o
interact in ps
?
They shouldn't work together, according to ps: output modifiers vs output format control and https://unix.stackexchange.com/a/446198/674, since -f
implicitly specifies the fields, while -o
allows user to specify the fields.
man ps
says
-f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format
keyword comm.
f ASCII art process hierarchy (forest).
They seem to be unrelated options/arguments.
But why
ps -f -o cmd
works just likeps f
, showing the parent-child relation?
ps -f -o ...
select the same number of processes asps f
?
$ ps f | wc -l
224
$ ps -f -o pid | wc -l
224
ps -f
selects different processes with and without-o
?
$ ps -f | wc -l
5
-e
seems not work here?
$ ps -e -f -o pid,ppid,comm | wc -l
224
$ ps -e -f | wc -l
414
$ ps -e -o pid,ppid,comm | wc -l
414
Thanks.
ps
add a comment |
How do -f
and -o
interact in ps
?
They shouldn't work together, according to ps: output modifiers vs output format control and https://unix.stackexchange.com/a/446198/674, since -f
implicitly specifies the fields, while -o
allows user to specify the fields.
man ps
says
-f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format
keyword comm.
f ASCII art process hierarchy (forest).
They seem to be unrelated options/arguments.
But why
ps -f -o cmd
works just likeps f
, showing the parent-child relation?
ps -f -o ...
select the same number of processes asps f
?
$ ps f | wc -l
224
$ ps -f -o pid | wc -l
224
ps -f
selects different processes with and without-o
?
$ ps -f | wc -l
5
-e
seems not work here?
$ ps -e -f -o pid,ppid,comm | wc -l
224
$ ps -e -f | wc -l
414
$ ps -e -o pid,ppid,comm | wc -l
414
Thanks.
ps
add a comment |
How do -f
and -o
interact in ps
?
They shouldn't work together, according to ps: output modifiers vs output format control and https://unix.stackexchange.com/a/446198/674, since -f
implicitly specifies the fields, while -o
allows user to specify the fields.
man ps
says
-f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format
keyword comm.
f ASCII art process hierarchy (forest).
They seem to be unrelated options/arguments.
But why
ps -f -o cmd
works just likeps f
, showing the parent-child relation?
ps -f -o ...
select the same number of processes asps f
?
$ ps f | wc -l
224
$ ps -f -o pid | wc -l
224
ps -f
selects different processes with and without-o
?
$ ps -f | wc -l
5
-e
seems not work here?
$ ps -e -f -o pid,ppid,comm | wc -l
224
$ ps -e -f | wc -l
414
$ ps -e -o pid,ppid,comm | wc -l
414
Thanks.
ps
How do -f
and -o
interact in ps
?
They shouldn't work together, according to ps: output modifiers vs output format control and https://unix.stackexchange.com/a/446198/674, since -f
implicitly specifies the fields, while -o
allows user to specify the fields.
man ps
says
-f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format
keyword comm.
f ASCII art process hierarchy (forest).
They seem to be unrelated options/arguments.
But why
ps -f -o cmd
works just likeps f
, showing the parent-child relation?
ps -f -o ...
select the same number of processes asps f
?
$ ps f | wc -l
224
$ ps -f -o pid | wc -l
224
ps -f
selects different processes with and without-o
?
$ ps -f | wc -l
5
-e
seems not work here?
$ ps -e -f -o pid,ppid,comm | wc -l
224
$ ps -e -f | wc -l
414
$ ps -e -o pid,ppid,comm | wc -l
414
Thanks.
ps
ps
edited yesterday
Tim
asked yesterday
TimTim
28.4k79269491
28.4k79269491
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The ps
in a lot of Gnu/Linuxes has compatibility with at least two versions of ps
: from system V and BSD. Some options are from one, and some from the other.
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
add a comment |
1. and 2.:
Yes, ps -f -o ...
works just like ps f
, because ps -f -o ...
outputs the same as ps f -o ...
which is the output as process hierarchy.
Example:
ps -f -o user,pid,ppid,cmd
# is the same as
ps f -o user,pid,ppid,cmd
3.
ps -f
seems to select all processes of your current shell (tty) while while ps -f -o ...
outputs the processes of all ttys.
Example:
ps -f
# selects the same processes of current tty as
ps -o user,pid,ppid,cmd,tty
# and... have a look at the tty value here
ps -f -o user,pid,ppid,cmd,tty
4.
Yes, ps -ef
doesn't seem to work with -o
. You can add -H
for a hierarchy like in ps -eH -o user,pid,ppid,cmd
.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f510951%2fhow-do-f-and-o-interact-in-ps%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
The ps
in a lot of Gnu/Linuxes has compatibility with at least two versions of ps
: from system V and BSD. Some options are from one, and some from the other.
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
add a comment |
The ps
in a lot of Gnu/Linuxes has compatibility with at least two versions of ps
: from system V and BSD. Some options are from one, and some from the other.
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
add a comment |
The ps
in a lot of Gnu/Linuxes has compatibility with at least two versions of ps
: from system V and BSD. Some options are from one, and some from the other.
The ps
in a lot of Gnu/Linuxes has compatibility with at least two versions of ps
: from system V and BSD. Some options are from one, and some from the other.
answered yesterday
ctrl-alt-delorctrl-alt-delor
12.4k52661
12.4k52661
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
add a comment |
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
I can't get my head around the manual, and just use the same few options. If anyone can reference a better manual, then +1 from me.
– ctrl-alt-delor
yesterday
add a comment |
1. and 2.:
Yes, ps -f -o ...
works just like ps f
, because ps -f -o ...
outputs the same as ps f -o ...
which is the output as process hierarchy.
Example:
ps -f -o user,pid,ppid,cmd
# is the same as
ps f -o user,pid,ppid,cmd
3.
ps -f
seems to select all processes of your current shell (tty) while while ps -f -o ...
outputs the processes of all ttys.
Example:
ps -f
# selects the same processes of current tty as
ps -o user,pid,ppid,cmd,tty
# and... have a look at the tty value here
ps -f -o user,pid,ppid,cmd,tty
4.
Yes, ps -ef
doesn't seem to work with -o
. You can add -H
for a hierarchy like in ps -eH -o user,pid,ppid,cmd
.
add a comment |
1. and 2.:
Yes, ps -f -o ...
works just like ps f
, because ps -f -o ...
outputs the same as ps f -o ...
which is the output as process hierarchy.
Example:
ps -f -o user,pid,ppid,cmd
# is the same as
ps f -o user,pid,ppid,cmd
3.
ps -f
seems to select all processes of your current shell (tty) while while ps -f -o ...
outputs the processes of all ttys.
Example:
ps -f
# selects the same processes of current tty as
ps -o user,pid,ppid,cmd,tty
# and... have a look at the tty value here
ps -f -o user,pid,ppid,cmd,tty
4.
Yes, ps -ef
doesn't seem to work with -o
. You can add -H
for a hierarchy like in ps -eH -o user,pid,ppid,cmd
.
add a comment |
1. and 2.:
Yes, ps -f -o ...
works just like ps f
, because ps -f -o ...
outputs the same as ps f -o ...
which is the output as process hierarchy.
Example:
ps -f -o user,pid,ppid,cmd
# is the same as
ps f -o user,pid,ppid,cmd
3.
ps -f
seems to select all processes of your current shell (tty) while while ps -f -o ...
outputs the processes of all ttys.
Example:
ps -f
# selects the same processes of current tty as
ps -o user,pid,ppid,cmd,tty
# and... have a look at the tty value here
ps -f -o user,pid,ppid,cmd,tty
4.
Yes, ps -ef
doesn't seem to work with -o
. You can add -H
for a hierarchy like in ps -eH -o user,pid,ppid,cmd
.
1. and 2.:
Yes, ps -f -o ...
works just like ps f
, because ps -f -o ...
outputs the same as ps f -o ...
which is the output as process hierarchy.
Example:
ps -f -o user,pid,ppid,cmd
# is the same as
ps f -o user,pid,ppid,cmd
3.
ps -f
seems to select all processes of your current shell (tty) while while ps -f -o ...
outputs the processes of all ttys.
Example:
ps -f
# selects the same processes of current tty as
ps -o user,pid,ppid,cmd,tty
# and... have a look at the tty value here
ps -f -o user,pid,ppid,cmd,tty
4.
Yes, ps -ef
doesn't seem to work with -o
. You can add -H
for a hierarchy like in ps -eH -o user,pid,ppid,cmd
.
answered yesterday
FreddyFreddy
1,514210
1,514210
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f510951%2fhow-do-f-and-o-interact-in-ps%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