Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to know if can safely shutdown my computer at home, by testing to see if my flatmate is using it. Therefore i use the command "w" in terminal. However the Idle time for tty seems strange (note I don't know much about linux or what tty means).

For example, a test of "w" command on my work machine shows that the idle time of my session is 14days? But i am using it now... this is something I don't understand.

w
USER  TTY   FROM  LOGIN@   IDLE   JCPU   PCPU WHAT
me    tty7  :0    09Apr13 14days  1:41m  3.07s gnome-session --session=ubuntu
share|improve this question

3 Answers 3

up vote 2 down vote accepted

The idle time is supposed to tell how long it has been since the user typed any input on that terminal. For Xwindows sessions, it is broken since Xwindows never reads input from a terminal, but instead gathers input directly from your mouse and keyboard, so the terminal never gets its timestamp updated since it is never read from.

share|improve this answer

Idle time is telling you from how long is running a process, in your case gnome-session --session=ubuntu is running from 14 days (your computer is open from 14 days).

share|improve this answer

There are at least 2 helpful hints in your "w" output which indicate that the entry you quote is referring to you logged in directly to the display which is physically connected to your Linux machine at home.

First, under the "TTY" column, you have "tty7". On a Linux machine, "gdm" or "gnome" or X-Windows in general will be running on tty7. When you are physically located at home, touching the keyboard physically connected to your machine, and you cycle through ctrl-alt-f1 up through ctrl-alt-f7, you are correspondingly cycling through tty1 through tty7, and when you get to tty7, you'll see X-Windows/gnome running.

Second, under the "FROM" column, you have ":0". When you see that, that always indicates the X-Windows running on the display which is physically connected to the machine.

The third clue is "gnome-session" under "WHAT", which in all probability would not be running on any display other than the one physically connected to your home machine.

So, 14 days ago you sat down at your machine at home and started an X-Windows/gnome session, and that's what you're seeing in the "w" output.

We also can deduce that you did not list the full output of "w", because you did not include the line of output which indicates that you're logged in to your home machine from work, which might list, for example, a "TTY" of "pts/0", a "FROM" of the IP address or name of your work machine, and "-bash" or "-tcsh" or some shell under "WHAT".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.