Date: Tue, 3 Apr 2012 23:13:13 +0200 From: Polytropon <freebsd@edvax.de> To: questions@freebsd.org Subject: Re: current pids per tty Message-ID: <20120403231313.6781abcc.freebsd@edvax.de> In-Reply-To: <CAB%2B9ogd011VRreE5pU5vVCqnvw=Ws-TGet_x9pr7fQF4keBRyQ@mail.gmail.com> References: <CAPkyVLzPuX3jxRRRVsJEtcYE%2B4kAaas50RuzbVByEUixuHhQdA@mail.gmail.com> <CAHHBGkqw865mGPS-9PSBfFa9qOJO8wJcrsTvfr4aoxw%2B0EF9Eg@mail.gmail.com> <CAB%2B9ogd011VRreE5pU5vVCqnvw=Ws-TGet_x9pr7fQF4keBRyQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 3 Apr 2012 16:47:57 -0400, Matthew Story wrote: > Across all TTYs, something like this would probably work: > > sudo fstat | awk '$5 ~ /^\/dev/ && $8 ~ /tty/ { printf "%s %s %s\n", $1, > $8, $3; }' | sort -k1,2 > > from there, if you think you need to trace the process trees down, you can > use this list of pids and ps to do the rest ... Or use "pstree" from ports. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120403231313.6781abcc.freebsd>