[olug] am I at the console?

Phil Brammer olug at wjjeep.com
Fri Mar 24 23:57:49 UTC 2006


On Fri, Mar 24, 2006 at 05:36:53PM -0600, Theodore Katseres wrote:
> tty
> 
> Capture the output and check for /dev/pty
> if that's true then its a remote console
> 
> Works for Linux and AIX

What he said, but look for /dev/pt* instead to make it more portable.  And running a terminal though a window manager will also yield a /dev/pt* tty output.

(The above is based on my Fedora installations which show my tty as being /dev/pts/n.)

Phil



More information about the OLUG mailing list