Linux self-study journey-basic commands (check the last log in time of all users in the system lastlog)

System trace command lastlog


Preface

1. In the previous section, we described the command last to view the information of all logged-in users in the system. If you haven’t read it, you can click on the link below to watch: last

2. In this section, we describe the command lastlog to view the last login time of all users in the system


The following is the text of this article

One, lastlog command format

  • Command name: lastlog
  • Location: /usr/bin/lastlog
  • Execution authority: all users
  • Function description: report the recent login status of all users, or the recent login status of a specified user
命令格式
[root@web ~]# lastlog

Two, lastlog command use

[root@web ~]# lastlog			<-直接输入命令回车即可
用户名           终端     	来源IP             最后登陆时间
root             pts/0    192.168.137.1    一 3月 29 08:35:45 +0800 2021
bin                                        **从未登录过**
daemon                                     **从未登录过**
adm                                        **从未登录过**
lp                                         **从未登录过**
sync                                       **从未登录过**
shutdown                                   **从未登录过**
halt                                       **从未登录过**
mail                                       **从未登录过**
operator                                   **从未登录过**
games                                      **从未登录过**
ftp                                        **从未登录过**
nobody                                     **从未登录过**
systemd-network                            **从未登录过**
dbus                                       **从未登录过**
polkitd                                    **从未登录过**
libstoragemgmt                             **从未登录过**
colord                                     **从未登录过**
rpc                                        **从未登录过**
saned                                      **从未登录过**
gluster                                    **从未登录过**
amandabackup                               **从未登录过**
saslauth                                   **从未登录过**
abrt                                       **从未登录过**
rtkit                                      **从未登录过**
pulse                                      **从未登录过**
radvd                                      **从未登录过**
unbound                                    **从未登录过**
chrony                                     **从未登录过**
rpcuser                                    **从未登录过**
nfsnobody                                  **从未登录过**
qemu                                       **从未登录过**
tss                                        **从未登录过**
usbmuxd                                    **从未登录过**
geoclue                                    **从未登录过**
ntp                                        **从未登录过**
sssd                                       **从未登录过**
setroubleshoot                             **从未登录过**
gdm              :0                        一 3月 29 08:32:34 +0800 2021
gnome-initial-setup :0                        三 2月 10 04:02:01 +0800 2021
sshd                                       **从未登录过**
avahi                                      **从未登录过**
postfix                                    **从未登录过**
tcpdump                                    **从未登录过**
snl              :0                        三 2月 10 04:04:08 +0800 2021
jh               :0                        五 2月 26 07:32:30 +0800 2021
apache                                     **从未登录过**
wangwu                                     **从未登录过**
zhangsan         pts/0    192.168.137.1    一 2月 22 17:13:38 +0800 2021
lamp             pts/0    192.168.137.1    一 2月 22 18:04:29 +0800 2021
stu1                                       **从未登录过**
stu2                                       **从未登录过**
stu3                                       **从未登录过**
tom                                        **从未登录过**
cw01                                       **从未登录过**
cw02                                       **从未登录过**
rs01                                       **从未登录过**
rs02                                       **从未登录过**
sc01                                       **从未登录过**
sc02                                       **从未登录过**
boss01                                     **从未登录过**
harry                                      **从未登录过**
natasha                                    **从未登录过**
sarsh                                      **从未登录过**
user01                                     **从未登录过**
user02                                     **从未登录过**
user03                                     **从未登录过**
user04                                     **从未登录过**
user05                                     **从未登录过**
nginx                                      **从未登录过**
snljh            pts/1    192.168.137.24   三 2月 24 14:57:26 +0800 2021
code             pts/3    192.168.137.24   三 2月 24 14:13:29 +0800 2021
la                                         **从未登录过**
named                                      **从未登录过**

This is Jiehua, see you next time!

Guess you like

Origin blog.csdn.net/qq313088385/article/details/115292739