LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 05-31-2004, 06: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, 09:09 AM   #2
Pete M
Member
 
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: 31
D. Marowa

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

http://www.linuxquestions.org/questi...hreadid=125406

Pete
 
Old 05-31-2004, 09:54 AM   #3
mikshaw
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, 06:13 PM   #4
Santas
Member
 
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, 09: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 10:36 PM.
 
Old 06-06-2004, 08:47 PM   #6
D. Marowa
LQ Newbie
 
Registered: Mar 2004
Posts: 13

Original Poster
Rep: Reputation: 0
self-response

the command is fgconsole

thanks
 
  


Reply


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 09:26 PM
How to enlarge the number of tty ? linux521 Linux - Newbie 2 04-14-2005 05:21 AM
max number of tty alaios Linux - Newbie 3 07-14-2004 01:23 AM
how to find correct tty number? SeanatIL Linux - Hardware 1 07-07-2004 08:03 PM
Bash: tty: command not found p0rt Linux - General 5 10-02-2003 12:38 PM


All times are GMT -5. The time now is 11:04 AM.

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