Operating System - Linux
1821984 Members
3361 Online
109638 Solutions
New Discussion юеВ

PS -ef command doesn't show all the details

 
SOLVED
Go to solution
Jorge Cocomess
Super Advisor

PS -ef command doesn't show all the details

Greetings,
When I run a command "ps -ef | grep monitor" and I get part of the message on one server. However, on another server I get the complete all the details. Currently, we are running RHAS 3.0 -

Please let me know if you know the answer.

Thanks,
J
7 REPLIES 7
Matti_Kurkela
Honored Contributor
Solution

Re: PS -ef command doesn't show all the details

What is missing? The beginning part of the line, the end or something else?

If the partial message looks like it's the wrapped part of a long line, it might be that on one server, the "monitor" process is started with the full path and on the other server without. With the full path, the command name might be long enough to wrap to the next line. And grep picks just the line that has the keyword, not the one before it...

Still, on Linux, ps is often smart enough to detect if its output is being piped and not wrap the lines in that case.

Also check that there are no aliases or shell function definitions that would add some extra options to the ps command line: type "alias" to see a list of all shell aliases and "typeset -f" to see a list of defined (bash) shell functions.
MK
Jorge Cocomess
Super Advisor

Re: PS -ef command doesn't show all the details

Matti - Thanks for your response. It's missing the details toward the end of the line, such as name_of_the_job and the description. However, if I just execute the command "ps -ef", that will give me what I wanted but also include all of the processes that I don't care much for.


Regards,
J
Ivan Ferreira
Honored Contributor

Re: PS -ef command doesn't show all the details

Have you trying setting the COLUMN variable? For example:

export COLUMNS=300
ps -ef |grep monitor
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sheriff Andy
Trusted Contributor

Re: PS -ef command doesn't show all the details

Are you looking for ps -efl (the l is for long listing).
Jorge Cocomess
Super Advisor

Re: PS -ef command doesn't show all the details

I will try these commands.

~ Many Thanks,

J
cmac
Occasional Advisor

Re: PS -ef command doesn't show all the details

Jorge,

This annoyed me for years and I'm pretty sure I tried the COLUMNS option. What you want is the w option but note that these accumulate (up to a maximum of maybe 3?). So, one of my standard aliases on linux is:

alias psw='ps -auxfwww'

And I think this is about as much as you can get. Now if someone can tell me the equivalent on HP-UX and/or Solaris (across different versions)...
richtl
Advisor

Re: PS -ef command doesn't show all the details

I can't get complete display using ps -aef on HP-UX ,filed in COMMNAD coulumn is cutting off.