简体   繁体   English

linux中的last命令在第3列显示`:0`,这是什么意思?

[英]last command in linux shows `:0` in 3rd column, what does it mean?

I want to write a shell script sort out the data that last command shows. 我想写一个shell脚本来整理last命令显示的数据。 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 . 我做了一些搜索,有一些说法:0.0第3列中的:0.0表示本地登录,第二列表示使用了什么类型的终端,如ptstty

But what does the :0 in line 2 second column in my log? 但是我的日志中第2行第二列的:0是什么?
I am using redhat 6.5. 我使用的是redhat 6.5。

It means local computer. 这意味着本地计算机。 Generally each session represented by pairs ip_address:display_number . 通常每个会话由对ip_address:display_number When you logged in locally the IP address is omitted. 在本地登录时,省略了IP地址。 That's why there is nothing before : . 这就是之前没有任何事情的原因: Display number is actually the session number from the specified IP address. 显示号码实际上是指定IP地址的会话号码。 So, 0 means the first session 所以,0表示第一个会话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM