UNIX-, BSD-, GNU-options in Linux's ps command. Where are they from?2019 Community Moderator ElectionCommand options with hyphen or notWhich to choose - BSD or Unix-style commands where available?Who are these BSD Unix contributors?What is the difference between Unix, Linux, BSD and GNU?When and how was the double-dash (--) introduced as an end of options delimiter in Unix/Linux?Using options of different kinds in ps commandsLinux Vs UNIX - kernel - How to understand the difference?Using sed command arguments to be compatible with both GNU & BSD Unix (in-place editing)Reliably determine free memoryWhich flags of the “ps” command are for the Unix flags format and which flags are for the BSD flags format?Is general (POSIX) shell language allowed in /etc/sysconfig/* scripts? Or are there restrictions?

Reply 'no position' while the job posting is still there

Proof of Lemma: Every nonzero integer can be written as a product of primes

Freedom of speech and where it applies

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

We have a love-hate relationship

Why is Arduino resetting while driving motors?

Varistor? Purpose and principle

Can someone explain how this makes sense electrically?

Do the concepts of IP address and network interface not belong to the same layer?

Difference between -| and |- in TikZ

Proving a function is onto where f(x)=|x|.

Has Darkwing Duck ever met Scrooge McDuck?

Indicating multiple different modes of speech (fantasy language or telepathy)

Journal losing indexing services

How do ground effect vehicles perform turns?

About a little hole in Z'ha'dum

How should I respond when I lied about my education and the company finds out through background check?

When quoting, must I also copy hyphens used to divide words that continue on the next line?

How do I implement a file system driver driver in Linux?

Longest common substring in linear time

Can I use my Chinese passport to enter China after I acquired another citizenship?

Greco-Roman egalitarianism

Can the Supreme Court overturn an impeachment?

Gibbs free energy in standard state vs. equilibrium



UNIX-, BSD-, GNU-options in Linux's ps command. Where are they from?



2019 Community Moderator ElectionCommand options with hyphen or notWhich to choose - BSD or Unix-style commands where available?Who are these BSD Unix contributors?What is the difference between Unix, Linux, BSD and GNU?When and how was the double-dash (--) introduced as an end of options delimiter in Unix/Linux?Using options of different kinds in ps commandsLinux Vs UNIX - kernel - How to understand the difference?Using sed command arguments to be compatible with both GNU & BSD Unix (in-place editing)Reliably determine free memoryWhich flags of the “ps” command are for the Unix flags format and which flags are for the BSD flags format?Is general (POSIX) shell language allowed in /etc/sysconfig/* scripts? Or are there restrictions?










5















In the manual for the ps command on Ubuntu there is this text:




This version of ps accepts several kinds of options:



 1 UNIX options, which may be grouped and must be preceded by a
dash.
2 BSD options, which may be grouped and must not be used with
a dash.
3 GNU long options, which are preceded by two dashes.



Why is it possible that a command built in Ubuntu uses options from different operating systems? I know that the origin of Linux, UNIX and BSD are the same but they are different branches.










share|improve this question



















  • 4





    I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

    – Mat
    Jun 8 '13 at 11:09











  • I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

    – JdeBP
    yesterday















5















In the manual for the ps command on Ubuntu there is this text:




This version of ps accepts several kinds of options:



 1 UNIX options, which may be grouped and must be preceded by a
dash.
2 BSD options, which may be grouped and must not be used with
a dash.
3 GNU long options, which are preceded by two dashes.



Why is it possible that a command built in Ubuntu uses options from different operating systems? I know that the origin of Linux, UNIX and BSD are the same but they are different branches.










share|improve this question



















  • 4





    I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

    – Mat
    Jun 8 '13 at 11:09











  • I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

    – JdeBP
    yesterday













5












5








5


1






In the manual for the ps command on Ubuntu there is this text:




This version of ps accepts several kinds of options:



 1 UNIX options, which may be grouped and must be preceded by a
dash.
2 BSD options, which may be grouped and must not be used with
a dash.
3 GNU long options, which are preceded by two dashes.



Why is it possible that a command built in Ubuntu uses options from different operating systems? I know that the origin of Linux, UNIX and BSD are the same but they are different branches.










share|improve this question
















In the manual for the ps command on Ubuntu there is this text:




This version of ps accepts several kinds of options:



 1 UNIX options, which may be grouped and must be preceded by a
dash.
2 BSD options, which may be grouped and must not be used with
a dash.
3 GNU long options, which are preceded by two dashes.



Why is it possible that a command built in Ubuntu uses options from different operating systems? I know that the origin of Linux, UNIX and BSD are the same but they are different branches.







linux ps bsd arguments






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 14 '13 at 23:04









Gilles

544k12811011619




544k12811011619










asked Jun 8 '13 at 10:37









YarLinuxYarLinux

4951410




4951410







  • 4





    I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

    – Mat
    Jun 8 '13 at 11:09











  • I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

    – JdeBP
    yesterday












  • 4





    I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

    – Mat
    Jun 8 '13 at 11:09











  • I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

    – JdeBP
    yesterday







4




4





I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

– Mat
Jun 8 '13 at 11:09





I don't understand what you're asking, really. It's just different argument "styles". There's nothing "interesting" happening here except for the impressively huge set of possible arguments that ps takes.

– Mat
Jun 8 '13 at 11:09













I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

– JdeBP
yesterday





I have nominated this for reopening because the closure reason is false. Speaking as someone who has done the research: It is possible to answer this with facts. The current answer is guesswork, is wrong guesswork; yet a correct answer cannot be added.

– JdeBP
yesterday










1 Answer
1






active

oldest

votes


















11














I just can give you an overall answer:
Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a hint to the real use, like -h for help or -v for version information or verbose output.



In Linux, and the often associated standard C library glibc, there is the extension to getopt to also handle -- - like options. Coming with this is that many commands developed under GNU (like glibc) used this extension. Now for many commands you also have the GNU-like style option. -v and --verbose, -h and --help and so on. I guess the same happened in BSD (though I am no BSD guy, please correct me).



Your ps command comes from a software collection called procps and I guess that they want to mimic the option style specific for a certain platform. So for the UNIX guys it has - options. For BSD it also accepts something like ps aux and so on.



ps is not the only program behaving like this. Many of the standard programs understand the "old" UNIX style (POSIX) and some modern extensions.






share|improve this answer




















  • 1





    Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

    – user26112
    Jun 8 '13 at 11:51










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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f78691%2funix-bsd-gnu-options-in-linuxs-ps-command-where-are-they-from%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









11














I just can give you an overall answer:
Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a hint to the real use, like -h for help or -v for version information or verbose output.



In Linux, and the often associated standard C library glibc, there is the extension to getopt to also handle -- - like options. Coming with this is that many commands developed under GNU (like glibc) used this extension. Now for many commands you also have the GNU-like style option. -v and --verbose, -h and --help and so on. I guess the same happened in BSD (though I am no BSD guy, please correct me).



Your ps command comes from a software collection called procps and I guess that they want to mimic the option style specific for a certain platform. So for the UNIX guys it has - options. For BSD it also accepts something like ps aux and so on.



ps is not the only program behaving like this. Many of the standard programs understand the "old" UNIX style (POSIX) and some modern extensions.






share|improve this answer




















  • 1





    Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

    – user26112
    Jun 8 '13 at 11:51















11














I just can give you an overall answer:
Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a hint to the real use, like -h for help or -v for version information or verbose output.



In Linux, and the often associated standard C library glibc, there is the extension to getopt to also handle -- - like options. Coming with this is that many commands developed under GNU (like glibc) used this extension. Now for many commands you also have the GNU-like style option. -v and --verbose, -h and --help and so on. I guess the same happened in BSD (though I am no BSD guy, please correct me).



Your ps command comes from a software collection called procps and I guess that they want to mimic the option style specific for a certain platform. So for the UNIX guys it has - options. For BSD it also accepts something like ps aux and so on.



ps is not the only program behaving like this. Many of the standard programs understand the "old" UNIX style (POSIX) and some modern extensions.






share|improve this answer




















  • 1





    Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

    – user26112
    Jun 8 '13 at 11:51













11












11








11







I just can give you an overall answer:
Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a hint to the real use, like -h for help or -v for version information or verbose output.



In Linux, and the often associated standard C library glibc, there is the extension to getopt to also handle -- - like options. Coming with this is that many commands developed under GNU (like glibc) used this extension. Now for many commands you also have the GNU-like style option. -v and --verbose, -h and --help and so on. I guess the same happened in BSD (though I am no BSD guy, please correct me).



Your ps command comes from a software collection called procps and I guess that they want to mimic the option style specific for a certain platform. So for the UNIX guys it has - options. For BSD it also accepts something like ps aux and so on.



ps is not the only program behaving like this. Many of the standard programs understand the "old" UNIX style (POSIX) and some modern extensions.






share|improve this answer















I just can give you an overall answer:
Command line options are often parsed using the library function getopt. Originally it only accepted arguments consisting of a - followed by a symbol. This effectively limits the amount of options you have, more or less -A to -Z, -a to -z and -0 to -9. You can imagine that you will not use an option without at least a hint to the real use, like -h for help or -v for version information or verbose output.



In Linux, and the often associated standard C library glibc, there is the extension to getopt to also handle -- - like options. Coming with this is that many commands developed under GNU (like glibc) used this extension. Now for many commands you also have the GNU-like style option. -v and --verbose, -h and --help and so on. I guess the same happened in BSD (though I am no BSD guy, please correct me).



Your ps command comes from a software collection called procps and I guess that they want to mimic the option style specific for a certain platform. So for the UNIX guys it has - options. For BSD it also accepts something like ps aux and so on.



ps is not the only program behaving like this. Many of the standard programs understand the "old" UNIX style (POSIX) and some modern extensions.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 18 '18 at 0:37









Jeff Schaller

43.8k1161141




43.8k1161141










answered Jun 8 '13 at 11:34









AlphaOneAlphaOne

1113




1113







  • 1





    Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

    – user26112
    Jun 8 '13 at 11:51












  • 1





    Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

    – user26112
    Jun 8 '13 at 11:51







1




1





Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

– user26112
Jun 8 '13 at 11:51





Welcome to the Unix & Linux stackexchange! You're off to an excellent start.

– user26112
Jun 8 '13 at 11:51

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f78691%2funix-bsd-gnu-options-in-linuxs-ps-command-where-are-they-from%23new-answer', 'question_page');

);

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