Re: showing which path a user program runs from?

2004-09-14 Thread Giorgos Keramidas
On 2004-09-14 12:00, Jez Hancock <[EMAIL PROTECTED]> wrote:
> On Mon, 13 Sep 2004 22:37:33 -0400, robg <[EMAIL PROTECTED]> wrote:
> > hi, say im the user 'rob' and i have the same program in two seperate
> > folders in my /home dir and run both.. if i run ps it shows me im
> > running both, but how can i find out which location folder is running
> > which program shown in ps
>
> Try using the -w option to the ps commandline more than once:
>
> ps auxww
>
> that should give you a complete listing that includes the full
> commandline.  See the manpage for more info on ps:
>
>  -w  Use 132 columns to display information, instead of the default
>  which is your window size.  If the -w option is specified more
>  than once, ps will use as many columns as necessary without
>  regard for your window size.

Not always, not for all the programs.  I don't think there's a way to do
what the OP wanted 100% of the time, at least not with ps(1):

$ ps auxww | grep -v grep | egrep -e 'xinit|screen'
root   604  0.0  0.7  3336 3004  ??  Is2:24PM   0:00.03 screen -a -D -RR
root   615  0.0  0.7  3636 3304  ??  Ss2:24PM   0:00.32 screen -a -D -RR
root   598  0.0  0.3  1940 1472  p0  S+2:24PM   0:00.16 screen -a -D -RR
keramida   613  0.0  0.3  1940 1544  p2  Ss+   2:24PM   0:00.08 screen -a -D -RR
keramida   567  0.0  0.3  1992 1260  v0  I+2:23PM   0:00.01 xinit 
/home/keramida/.xinitrc -- /usr/X11R6/bin/X -dpi 90
$

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: showing which path a user program runs from?

2004-09-14 Thread Jez Hancock
On Mon, 13 Sep 2004 22:37:33 -0400, robg <[EMAIL PROTECTED]> wrote:
> hi, say im the user 'rob' and i have the same program in two seperate
> folders in my /home dir and run both.. if i run ps it shows me im
> running both, but how can i find out which location folder is running
> which program shown in ps

Try using the -w option to the ps commandline more than once:

ps auxww

that should give you a complete listing that includes the full
commandline.  See the manpage for more info on ps:

 -w  Use 132 columns to display information, instead of the default
 which is your window size.  If the -w option is specified more
 than once, ps will use as many columns as necessary without
 regard for your window size.



-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/- ipfw peruser traffic logging
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: showing which path a user program runs from?

2004-09-13 Thread Mike Jeays
On Mon, 2004-09-13 at 22:37, robg wrote:
> hi, say im the user 'rob' and i have the same program in two seperate
> folders in my /home dir and run both.. if i run ps it shows me im
> running both, but how can i find out which location folder is running
> which program shown in ps

The "which" command will tell you the fully-qualified path name of any
executable that can be found in the $PATH variable.  It will search in
order of the directories in the path.

So, if your program is "myprog", run the command "which myprog".


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


showing which path a user program runs from?

2004-09-13 Thread robg
hi, say im the user 'rob' and i have the same program in two seperate
folders in my /home dir and run both.. if i run ps it shows me im
running both, but how can i find out which location folder is running
which program shown in ps

-- 
robg
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"