Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-31-2004, 05:40 AM   #1
D. Marowa
LQ Newbie
Registered: Mar 2004
Posts: 13

Rep: Reputation: 0
command to get tty number

How to get tty number displaying in the screen.
Example, I run a program in module by cron.(automatically)
But I want to get the tty number that displayed in the monitor,
in the program that executed by cron.

Any command to get the tty number?
Old 05-31-2004, 08:09 AM   #2
Pete M
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
D. Marowa

Not really sure what you are looking for but this thread might help

Old 05-31-2004, 08:54 AM   #3
LQ Addict
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
tty is a command you can use
Old 05-31-2004, 05:13 PM   #4
Registered: Jun 2003
Location: Over the rainbow
Distribution: Mandrake 10 / Guadalinex
Posts: 290

Rep: Reputation: 30
you can also use who
Old 05-31-2004, 08:45 PM   #5
D. Marowa
LQ Newbie
Registered: Mar 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks All.

I want a command to get tty number that displayed in screen from another tty/terminal.
For another example, /dev/tty1 is displayed on the machine1 screen.
I connect to machine1 from machine2 by telnet.
(tty number is /dev/pts/0)
I want to get tty number that displayed on the machine1 screen by a command.
(in this example will be /dev/tty1)

Last edited by D. Marowa; 05-31-2004 at 09:36 PM.
Old 06-06-2004, 07:47 PM   #6
D. Marowa
LQ Newbie
Registered: Mar 2004
Posts: 13

Original Poster
Rep: Reputation: 0

the command is fgconsole



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to switch to a tty with a command? sh0 Linux - Software 3 12-17-2009 08:26 PM
How to enlarge the number of tty ? linux521 Linux - Newbie 2 04-14-2005 04:21 AM
max number of tty alaios Linux - Newbie 3 07-14-2004 12:23 AM
how to find correct tty number? SeanatIL Linux - Hardware 1 07-07-2004 07:03 PM
Bash: tty: command not found p0rt Linux - General 5 10-02-2003 11:38 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration