In the old days, a "ps -e" on Linux would get you something like
warning: `-' deprecated; use `ps e', not `ps -e'
PID TTY STAT TIME COMMAND
To get that now, you need to use "oldps". The man page (which
you can still see with "man oldps") warned:
For now, ps will give you a warning if you use a `-' for a
short option, but it will still work. If you have shell
scripts which use BSD-style arguments to ps, take heed of
the warning and fix them, or else your scripts will fail
to function correctly at some point in the future. If you
want to turn off the warnings, set the I_WANT_A_BROKEN_PS
When I first saw this, it ticked me off. From time to time, I've
even made comments like:
Personally, I think bsd ps semantics are "broken", not the
other way around. But if I were putting in such a flag,
I'd call it "I_WANT_BSD_FLAGS".
Well, I was wrong. Albert
Cahalan (see the end of "man ps") set me straight:
I think Michael K. Johnson named that option, not me,
but I support the naming and the code behind it.
If you set that option, you make ps violate the POSIX and
UNIX standards. The common "ps -ef" command will not work.
(this is an ISO, IEEE, Open Group, and ANSI standard)
According to the standards, "ps -aux" is parsed the same
way as "ps -a -u x", with "x" being a username!
People who want the BSD options get them by default anyway,
with less typing. Why type "ps -aux" when "ps aux" will work?
Besides, it's more portable to leave off the "-". You can
use "ps aux" on AIX or Tru64, along with "ps -ef", but you
can't use "ps -aux" on those systems at all.
I like using both BSD and UNIX syntax, sometimes together.
ps f -ef
ps -C bash,xterm u
OK, I see the error of my ways. But.. the new ps doesn't seem to
mind using "ps -e" at all. So the warning seems not to have come
true, at least not yet.
Reading the newer "man ps", I found this :
none "Do the right thing"
aix like AIX ps
bsd like FreeBSD ps
compaq like Digital Unix ps
debian like the old Debian ps
digital like Digital Unix ps
gnu like the old Debian ps
hp like HP-UX ps
hpux like HP-UX ps
irix like Irix ps
linux deviate from Unix98 for convenience only
old like the original Linux ps
sco like SCO ps
sgi like Irix ps
sun like SunOS 4 ps
sunos like SunOS 4 ps
That made me think that if I set PS_PERSONALITY to "old" (and
exported it) that "ps -e" would act like "oldps -e", but it doesn't
(at least not on the system I tried it on). However, setting and
exporting CMD_ENV did alter the behaviour as expected, though you
don't get the "deprecated" message.
It's fun to play with the various settings. I notice that "sco"
is one of the options, though I'm not sure what effects that has.
Perhaps it causes "ps" to spawn a lawsuit?
See How "ps" works and why also.
If this page was useful to you, please help others find it:
More Articles by Tony Lawrence
- Find me on Google+
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Jump to Comments
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.