I have some processes that show a long file path as part of the process name and the process name gets truncated off.
Does anyone know how to get the full output from the `ps`command so that I can see the whole process name?
I have some processes that show a long file path as part of the process name and the process name gets truncated off.
Does anyone know how to get the full output from the `ps`command so that I can see the whole process name?
It might not matter but what OS?
Try first setting your term window to wrap and possibly 132 characters. If none of this works - you could send the output to a file and vi it (if your really wanting to see the output).
The OS is HP-UX 11.0.
I've tried sending the output to a file and it still gets truncated. I've noticed in the man page that there is a -o option that will allow me to specify certain columns but it only works with XPG4. I don't know what XPG4 is or how I use it.
I jumped on a HP server and saw the same problem. I set my TERM to vt100 and then the line wrapped.
sh or ksh
$ export TERM=vt100
or
$ TERM=vt100; export TERM
csh
setenv TERM vt100
How long is the pathname?
As for XPG4...
The command line is apparently longer than 40 characters. I can't see just how long the command line is because it is running from a large batch in the middle of the night and I don't know exactly the commands that are being called. (That's what I'm trying to find out).
Thank you for your reply. I guess I'll have to figure out another way.
If you are only getting 40 characters, something else is wrong. I am getting 60 characters. I actually expected a few more characters. /usr/include/sys/pstat.h sets PST_CLEN at 64. I assume that includes a terminating null, so I should be able to see 63 characters. I don't know where my other 3 characters went.
I don't think the ps that is shipped with HP-UX will understand BSD-style options, but in case I'm wrong, try:
ps auw
Also, it may understand the Unix98 (I think) ps options:
ps -efw
And just to refresh my memory, HP-UX 11 doesn't use the /proc filesystem, does it? If I'm mistaken, and it actually does, try :
ll /proc/(pid#)/exe
Try
ps eww <process number>
It'll give you the full command and the environment variables
when the process was created
GOOD LUCK
HP-UX, at present, can support UNIX95 but not UNIX98. And UNIX98 does not support a -w option to ps anyway. To verify that I followed the link that Neo added to the standard. The language is very interesting...
And later...
HP, for better or worse, wanted to be able to obtain a high security rating for HP-UX. Their B level version of HP-UX is a different product, but it shares much code with plain old HP-UX. Not only does HP's ps have no way of displaying the environment variables of other processes, but there is no way to do that under HP-UX. The only reason that ps has any shot of displaying the command line is that the kernel saves a copy of the command as it exec()'s a process. But the area where it is saved is only 64 bytes. There is no hope of writing a version of ps that displays more than that on HP-UX short of modifying the kernel to save more of the command line.
I'm not sure what "ll /proc/$pid/exe" is supposed to do. But there is no standard for what a /proc filesystem contains. On SunOS, I went to a /proc entry and did an ls. I got:
as ctl lpsinfo lwp pagedata root usage
auxv cwd lstatus map psinfo sigact watch
cred fd lusage object rmap status xmap
And none of those files is ascii data that be simply printed out. But HP-UX has no /proc filesystem anyway.
Sorry for the bad news, folks. But there are some differences among the various versions of UNIX. You can't take everything you know about your own version of UNIX and assume that it will work everywhere.