LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ps (process status) command, PS_FORMAT how to set? (https://www.linuxquestions.org/questions/linux-general-1/ps-process-status-command-ps_format-how-to-set-38630/)

alexander 12-17-2002 08:12 AM

ps (process status) command, PS_FORMAT how to set?
 
Hi!
I often use:
ps -e -o pid,ppid,user,tty,cmd

man page states that I could use $PS_FORMAT to set default format for ps. But it fails:


$ export PS_FORMAT='pid,ppid,user,tty,cmd'
$ ps
spec value pid,ppid,user,tty,cmd not found

at the same time
the following works fine:
$ export PS_FORMAT='pid'
:confused:

Any idea?

PS> I tried a lot of options with $PS_FORMAT (AIX, BSD style) and no success :(

Mik 12-17-2002 09:53 AM

The man page isn't really clear on the PS_FORMAT variable. It does say that in general it's not good to set these variables. When I try setting it to more then one field ps just crashes and generates a core file.

Something you could do instead of setting the variable is create an alias, something like:

alias ps="ps -o pid,ppid,user,tty,cmd"

alexander 12-18-2002 03:38 AM

Quote:


alias ps="ps -o pid,ppid,user,tty,cmd"

That must be a good solution, thank you.:D


All times are GMT -5. The time now is 11:28 PM.