5

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

3 Answers 3

5

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.

4

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".

1

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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .