3

I want to write a shell script sort out the data that last command shows. I got this in my server.

 root    pts/0        10.168.136.175     Wed Sep 14 14:24 - 14:54   (00:29)        
 root    :0                              Mon Sep 12 10:34 - 11:00   (00:25)       
 reboot  system boot  2.6.18-308.el5PA   Sun Sep 11 11:31           (86+03:05)

I did some search, there are some saying :0.0 in the 3rd column means login locally, second column means what kind of terminal been use, like pts and tty.

But what does the :0 in line 2 second column in my log?
I am using redhat 6.5.

hemalp108
  • 1,209
  • 1
  • 15
  • 23
Joshua Lee
  • 121
  • 1
  • 9

1 Answers1

2

It means local computer. Generally each session represented by pairs ip_address:display_number. When you logged in locally the IP address is omitted. That's why there is nothing before :. Display number is actually the session number from the specified IP address. So, 0 means the first session

Eugene
  • 2,858
  • 1
  • 26
  • 25
  • Display number does not represent a session number, it represents a display/screen pair. See [How can I specify a display?](http://stackoverflow.com/q/784404/45249) for more information. – mouviciel Dec 06 '16 at 09:03
  • @mouviciel You are right. I've used the term 'session', because it's more intuitive. For many people that are not acquainted with X Server terminology the term 'display' is misleading. – Eugene Dec 06 '16 at 09:22