From owner-freebsd-questions@FreeBSD.ORG Tue Sep 14 11:39:45 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C781C16A4CE for ; Tue, 14 Sep 2004 11:39:45 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 566AD43D45 for ; Tue, 14 Sep 2004 11:39:43 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i8EBdebA017984; Tue, 14 Sep 2004 14:39:40 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i8EBdYnM000850; Tue, 14 Sep 2004 14:39:34 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)i8EBdYwS000849; Tue, 14 Sep 2004 14:39:34 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 14 Sep 2004 14:39:34 +0300 From: Giorgos Keramidas To: Jez Hancock Message-ID: <20040914113934.GB767@orion.daedalusnetworks.priv> References: <5c389d3b04091319371aef7e73@mail.gmail.com> <7b3c7f0b04091404007186efa2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b3c7f0b04091404007186efa2@mail.gmail.com> cc: freebsd-questions@freebsd.org cc: robg Subject: Re: showing which path a user program runs from? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2004 11:39:45 -0000 On 2004-09-14 12:00, Jez Hancock wrote: > On Mon, 13 Sep 2004 22:37:33 -0400, 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 > > 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 ?? Is 2:24PM 0:00.03 screen -a -D -RR root 615 0.0 0.7 3636 3304 ?? Ss 2: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 $