'ps' behavoir in Linux - Was - Re: array limits

Jerry Rains jmrains at peoplepc.com
Fri Apr 16 19:35:59 PDT 2004


On Friday 16 April 2004 08:40, Fairlight wrote:
> On Fri, Apr 16, 2004 at 08:02:06AM -0500, Ryan Powers, the prominent
> pundit,
>
> witicized:
> > On Thu, Apr 15, 2004 at 07:47:04PM -0500, Jerry Rains said:
> > > This brings up a point I have been meaning to post for a while.  Brians
> > > ps command works fine on SCO5.0.5 but on SuSE8.2
> > >
> > > ps -eo args | grep dclerk   returns
> > >
> > > [dclerk]
> > >
> > > This gives me no idea which filePro file or what process table is being
> > > run. I looked through 'man ps', but I found no other argument that did
> > > any better.
> >
> > Once you obtain the pid you could use lsof to list the open files
> > under that process.
>
> Or under linux, `ls -l /proc/$PID/fd` and look at what the symlinks point
> to for each fd.  No program use necessary.

This tells the files open but not the program that opened them and, again no 
arguments.  Also, I have to be 'root' to list the directory.

Coastal:/proc/29589/fd # l
total 0
dr-x------    2 root     root            0 2004-04-16 20:58 ./
dr-xr-xr-x    3 filepro  users           0 2004-04-16 20:58 ../
lrwx------    1 root     root           64 2004-04-16 20:58 0 -> /dev/pts/2
lrwx------    1 root     root           64 2004-04-16 20:58 1 -> /dev/pts/2
lrwx------    1 root     root           64 2004-04-16 20:58 2 -> /dev/pts/2
lrwx------    1 root     root           64 2004-04-16 20:58 3 -> 
/appl/filepro/fpcust/key
lrwx------    1 root     root           64 2004-04-16 20:58 5 -> 
/appl/filepro/fpcust/index.A
lrwx------    1 root     root           64 2004-04-16 20:58 6 -> 
/appl/filepro/fpcust/index.B
Coastal:/proc/29589/fd #

I can get the program from /proc/$PID/exe

Coastal:/proc/29586/fd # cd /proc/29589
Coastal:/proc/29589 # l
-r--r--r--    1 root     root            0 2004-04-16 21:04 cmdline
-r--------    1 root     root            0 2004-04-16 21:04 environ
lrwxrwxrwx    1 root     root            0 2004-04-16 21:04 exe -> 
/appl/fp/dclerk*
dr-x------    2 root     root            0 2004-04-16 21:04 fd/
Coastal:/proc/29589 #

but again, no arguments.

Jerry

>
> mark->



More information about the Filepro-list mailing list