Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wanted to do a specific ps run on a Mac OS X 10.6 machine. According to man, the -f flag is available in BSD. Is it not available in Mac OS X? If so, why does man list it as an option?

I get illegal option and it highlights the -f flag. I have to sudo to get it to execute.

share|improve this question

1 Answer 1

According to man ps:

Display the uid, pid, parent pid, recent CPU usage, process start time, controling tty, elapsed CPU usage, and the associated command.

Works fine on my machine:

$ ps -f
  UID   PID  PPID   C     STIME TTY           TIME CMD
  501 58104 58103   0   0:00.01 ttys000    0:00.02 -bash

When getting illegal option then, according to some James Sadler, you need to run export COMMAND_MODE=unix2003. Indeed, on my account (admin, but not root), it is set like that. My OS X 10.6 is an upgrade going back to Tiger. In the same post, James also claims:

I have found that launching ps via iTerm would exhibit the problem but not when run via Terminal.app.

share|improve this answer
    
Bizarre. I get illegal option and it highlights the -f flag. I have to sudo to get it to execute...is this normal ? Thanks. –  Scott Davies Oct 30 '10 at 20:25
    
@Scott which ps? Mine is /bin/ps. –  Daniel Beck Oct 30 '10 at 21:04
    
@Scott, see my edit. –  Arjan Oct 30 '10 at 21:08
    
...though, after running unset COMMAND_MODE on my machine ps -f still runs fine without sudo. Also, sudo bash -c set | grep COMMAND_MODE yields nothing, though sudo ps -f runs fine too. Are you using bash and Terminal, @Scott? –  Arjan Oct 30 '10 at 21:25
    
Hi Arjan! I am using bash and a 3rd party console app. –  Scott Davies Nov 24 '10 at 0:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.