It seems that man pages on OSX are misaligned with the commands sometime.
Example:
From
$ man ps
I read:
-e Identical to -A.
But look how identical they are:
luigi@noname:~$ ps -e
PID TT STAT TIME COMMAND
12332 s000 S+ 0:00.03 -bash PATH=/usr/bin:/bin:/usr/sbin:/sbin TMPDIR=/var/folders/+K
12376 s001 R 0:00.03 -bash PATH=/usr/bin:/bin:/usr/sbin:/sbin TMPDIR=/var/folders/+K
luigi@noname:~$ ps -A
PID TT STAT TIME COMMAND
1 ?? Ss 0:02.20 /sbin/launchd
10 ?? Ss 0:06.80 /usr/libexec/kextd
11 ?? Ss 0:05.26 /usr/sbin/notifyd
13 ?? Ss 0:12.82 /usr/sbin/ntpd -c /private/etc/ntp-restrict.conf -n -g -p /var/
14 ?? Ss 4:17.86 /usr/sbin/update
15 ?? Ss 0:00.01 /sbin/SystemStarter
17 ?? Ss 0:02.47 /usr/sbin/syslogd
19 ?? Ss 0:01.87 /usr/sbin/securityd -i
21 ?? Ss 2:50.52 /System/Library/Frameworks/CoreServices.framework/Frameworks/Me
22 ?? Ss 0:16.24 /usr/sbin/mDNSResponder -launchd
23 ?? Ss 6:19.50 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/log
24 ?? Ss 0:00.02 /usr/sbin/KernelEventAgent
26 ?? Ss 9:14.55 /usr/libexec/hidd
27 ?? Ss 0:24.74 /System/Library/Frameworks/CoreServices.framework/Versions/A/Fr
29 ?? Ss 0:00.00 /sbin/dynamic_pager -F /private/var/vm/swapfile
32 ?? Ss 0:03.85 /usr/sbin/diskarbitrationd
33 ?? Ss 0:24.93 /usr/sbin/DirectoryService
35 ?? Ss 0:35.43 /usr/sbin/configd
38 ?? Ss 0:00.13 autofsd
39 ?? Ss 0:03.07 /usr/libexec/ApplicationFirewall/socketfilterfw
40 ?? Ss 0:00.02 /Library/Application Support/iStat menus/iStatMenusProcessServe
41 ?? Ss 0:08.00 /usr/sbin/distnoted
44 ?? Ss 0:32.01 /System/Library/CoreServices/coreservicesd
46 ?? Ss 0:03.18 /usr/sbin/blued
104 ?? Ss 90:40.66 /System/Library/Frameworks/ApplicationServices.framework/Framew
138 ?? Ss 0:02.60 /sbin/launchd
142 ?? S 0:00.63 /System/Library/CoreServices/AirPort Base Station Agent.app/Con
146 ?? S 0:06.82 /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotl
147 ?? S 0:00.87 /usr/sbin/UserEventAgent -l Aqua
149 ?? Ss 0:06.15 /usr/sbin/coreaudiod
150 ?? S 0:53.94 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_
152 ?? U 40:44.63 /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/
153 ?? S 4:51.92 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -
154 ?? S 0:47.90 /System/Library/Frameworks/ApplicationServices.framework/Framew
155 ?? S 0:00.00 /usr/sbin/pboard
165 ?? S 0:00.39 /Users/luigi/Library/Application Support/iStat menus/Helpers/iS
168 ?? S 0:03.39 /System/Library/Frameworks/InstantMessage.framework/iChatAgent.
360 ?? S 0:00.19 /System/Library/Services/AppleSpell.service/Contents/MacOS/Appl
1265 ?? S 0:00.02 /usr/bin/ssh-agent -l
2711 ?? U 8:18.73 /Applications/Path Finder.app/Contents/MacOS/Path Finder -psn_0
9364 ?? S 0:00.20 /Applications/iTunes.app/Contents/Resources/iTunesHelper.app/Co
9366 ?? Ss 0:00.01 /System/Library/PrivateFrameworks/MobileDevice.framework/Versio
12279 ?? SNs 0:01.16 /System/Library/Frameworks/CoreServices.framework/Frameworks/Me
12302 ?? S 3:42.39 /Applications/Firefox.app/Contents/MacOS/firefox-bin -psn_0_747
12315 ?? Ss 0:00.52 /System/Library/Frameworks/ApplicationServices.framework/Framew
12330 ?? S 0:17.35 /Applications/iTerm.app/Contents/MacOS/iTerm -psn_0_7513898
12352 ?? S 0:02.56 /Applications/VirtualBox.app/Contents/MacOS/VBoxSVC --pipe 8 --
12353 ?? S 0:00.36 /Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMIPCD
12373 ?? S 0:02.01 /Applications/VirtualBox.app/Contents/MacOS/VirtualBox -psn_0_7
12476 ?? S 0:08.90 /Applications/Preview.app/Contents/MacOS/Preview -psn_0_7583547
12331 s000 Ss 0:00.02 login -fp luigi
12332 s000 S+ 0:00.03 -bash
12375 s001 Ss 0:00.01 login -fp luigi
12376 s001 S 0:00.03 -bash
12530 s001 R+ 0:00.00 ps -A
Always from "man ps" I read:
-f Display the uid, pid, parent pid, recent CPU usage, process start time, controling tty,
elapsed CPU usage, and the associated command. If the -u option is also used, display
the user name rather then the numeric uid. When -o or -O is used to add to the display
following -f, the command field is not truncated as severely as it is in other formats.
Look how nice this option works:
luigi@noname:~$ ps -f
ps: illegal option -- f
usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
[-u]
[-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
ps [-L]
I noticed that those two options are not working because usually to check the PID of a process on linux I use the command "ps -ef". Both -e and -f don't work as expected on OSX. 100% failure.
Now I wonder where I have to read to know how the damn ps works on OSX.
Apple, next time, use Linux as base for your OS. At least man pages will reflect the commands. OSX really sucks.
I'm praying that Ubuntu will soon have a good hardware support for my macbook.
6 Responses to “man ps: OSX strikes back.”
Leave a Reply
Search
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | Apr » | |||||
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
Archives
Categories
- Android (3)
- Apple (27)
- Books (7)
- Eclipse (14)
- Errors (4)
- Firefox (7)
- Git (2)
- Hardware (17)
- Horror Code (8)
- Internet (21)
- Java (102)
- JavaScript (9)
- Life, universe and everything (46)
- Lifehacks (25)
- Linux (51)
- Opinions (26)
- OSX (6)
- Python (1)
- Software (31)
- Speeches and Conferences (8)
- Unix (4)
- Web (23)
- Windows (19)
Tag Cloud
Android apple architecture Bash configuration CSS Development Düsseldorf Eclipse Git Google Hardware hdr How-To Java JAXB job junit Karmic Linux lion MacBook music Open Source Opinion oracle OSX patterns Pitfalls Practices Resume Security Software Suspend TDD Testing tip tonemapped Tricks Ubuntu unix video Web Workaround XML
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Blog License
Blogs I like
Books on the desk
Friends' Blogs
- Antonio Terreno & Valter Bernardini
- Bruno Bossola
- Daniele Galluccio
- Domenico Ventura
- Ed Schepis
- Fabrizio Gianneschi
- Luca Grulla
- Luigi Zanderighi
- Marcello Teodori
- Mida Boghetich
- Muralidharan Chandrasekaran
- Piero Ricca
- Renzo Borgatti
- Simone Bordet
- Simone Bruno
- Uberto Barbini
- Valvolog
- Webtide blogs (Greg Wilkins & Jan Bartel)
Links




















You can fix the ps -ef (illegal option) problem by ensuring that the environment variable COMMAND_MODE is set to unix2003
I have found that launching ps via iTerm would exhibit the problem but not when run via Terminal.app.
Set the environment variable in your bashrc or profile (or better yet, in the system-wide version in /etc).
I can’t help you with the man page inconsistencies, although it may be that the man pages are documenting the unix2003 behaviour, and all might be consistent when you try running those commands again with unix2003
Hope that helps.
Thanks James!
Wow! It works for me too! Thanks to Luigi (for raising the question) and to James (for answering it)!
Dude I love you guys! Thank you so much for figuring this out James I was cursing Apple like crazy for this :)
I’m having the same headaches here. ps isn’t the only inconsistency in OSX. Maybe this is partly why Apple is discontinuing it.
The man page also speaks of -u for showing user name instead of the much more useless user id. -u doesn’t work with ps on OSX, even when COMMAND_MODE=unix2003. And it seems there’s no way to show user name with ps in OSX …?
Our sys builders should have gone with Linux or waited another year until Apple discontinued the XServe.
Da Man == James
thank you so much!