Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-21-2008, 07:24 AM   #1
LQ Newbie
Registered: Oct 2007
Posts: 14

Rep: Reputation: 0
How to know about last used terminal

Dear All,

I want to know the last virtual terminal number at which i was working.
Suppose initally i am working on virtual terminal 2 (using <Alt><ctrl>F2)
and then I switch to virtual terminal 7 (using <Alt><ctrl>F7) , then what should i do to know that my previous terminal was Virtual terminal 2.

Is there any command or set of command by which i could know this?

Thanks & Regards
Arun Tayal
Old 01-21-2008, 08:22 AM   #2
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Alright, I don't know exactly how to do this, but it is possible, therefore it may take a little research on your part.

When you log into a vty (virtual terminal - Ctrl+Alt+F2) for instance, and then you switch over to another one, vty3 for instance, and you log in there, you will see "user previously logged on to tty2 at [time stamp]".
Old 01-21-2008, 10:36 AM   #3
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
The last command displays previous logins.

If you are interested in a specific user, type

last username

To check logins from certain terminal(s), replace num with a number

last ttynum

last tty1
This example will show logins from terminal 1.

for more options, type man last

Note: Some distros use different names for terminals.
Arch linux, for example uses vc for it's terminal name.

Last edited by dv502; 01-21-2008 at 10:44 AM.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 10:34 AM
Switching back to the Mandrake 9.1 desktop from terminal rdesktop terminal session marc218 Linux - General 6 02-08-2007 02:45 PM
pressing 'x' in gnome terminal starts new terminal instance Drwfan54 Ubuntu 3 09-26-2006 03:09 PM
How to launch an app in terminal, & keep it running after I close terminal? kornerr Linux - General 7 06-24-2006 05:54 PM
Alternative terminal to konsole & gnome-terminal Adony Linux - Software 3 10-08-2004 03:59 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:26 AM.

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
Open Source Consulting | Domain Registration