当你新登录一个主机,过着管理一个主机,这时候你就需要这些命令来进行查看了:

1. w : Show who is logged on and what they are doing.

w [options] user [...]

常用命令:

w -h --no-header

w -u --no-current

w -s :   Use the short format.  Don't print the login time, JCPU or PCPU times.

w -i, --ip-addr : Display IP address instead of hostname for from field.

2. who : Show who is logged on

who -a, --all 展示所有的; 相当于 使用 -b -d --login -p -r -t -T -u

3. users: Print the user names of users currently logged in to the current host

4. whoami : Print effective userid

Print the user name associated with the current effective user ID.  Same as id -un.

5. last : last, lastb - show a listing of last logged in users

last -a

last [options] [username...] [tty...]

last  searches  back  through the /var/log/wtmp file (or the file designated by the -f option) and displays a list of all users logged in
(and out) since that file was created. One or more usernames and/or ttys can be given, in which case last will show only the entries
matching those arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0. When catching a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT signal, last will show how far it has
searched through the file; in the case of the SIGINT signal last will then terminate. The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of all the reboots since the log file
was created. lastb is the same as last, except that by default it shows a log of the /var/log/btmp file, which contains all the bad login attempts.

 last reboot 展示所有的机器重新启动的情况。

6. lastb:lastb is the same as last, except that by default it shows a log of the /var/log/btmp file, which contains all the bad login attempts.

在root 权限下,使用 lastb 命令,将会显示所有尝试登录失败的情况。

保持更新,转载请注明出处。

Linux 下查看系统当前登录用户信息的更多相关文章

  1. linux 下如何查看和踢除正在登陆的其它用户 ==>Linux下用于查看系统当前登录用户信息的4种方法

    在linux系统中用pkill命令踢出在线登录用户 由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍 所以需要有时踢出指定的用户 1/#who   查出当前有那些终端登录(用 ...

  2. Linux下用于查看系统当前登录用户信息 w命令

    作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...

  3. CentOS下用于查看系统当前登录用户信息的4种方法

    作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...

  4. Linux下用于查看系统当前登录用户信息的4种方法

    1. 使用w命令查看登录用户正在使用的进程信息 w命令用于显示已经登录系统的用户的名称,以及他们正在做的事.该命令所使用的信息来源于/var/run/utmp文件.w命令输出的信息包括: 用户名称 用 ...

  5. Linux下查看/管理当前登录用户及用户操作历史记录

    转载自: http://www.cnblogs.com/gaojun/archive/2013/10/24/3385885.html 一.查看及管理当前登录用户 1.使用w命令查看登录用户正在使用的进 ...

  6. 请给出linux中查看系统已经登录用户的命令?

    w命令 第一行:当前系统运行了多久和系统负载 谁正在远程登录系统并且在干什么 [root@martin ~]# w 11:30:33 up 4 days, 18:10, 2 users, load a ...

  7. Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录

    Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录 作为系统管理员,top命令看到users有多个用户登录,会需要查看下是否被黑客进入了. 实战例子:top命令:top - ...

  8. Linux下查看网卡驱动和版本信息

    Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet 查 ...

  9. Linux下查看Tomcat的控制台输出信息

    Linux下查看Tomcat的控制台输出信息 首先使用SSH连接到数据库,然后点击window创建一个new terminal, 进入tomcat/logs/文件夹下,输出控制台信息,命令如下: cd ...

随机推荐

  1. ubuntu下 远程连接windows服务器工具Remmina

    工具不错 https://blog.csdn.net/skykingf/article/details/71539237

  2. Linux编程 5 (目录重命名与移动mv,删除文件rm,目录创建mkdir删除rmdir,查看file,cat,more,tail,head)

    一. 文件重命名与移动(mv) 在linux中,重命名文件称为移动(moving).mv命令可以将文件和目录移动到另一个位置或重新命名. 1.1 使用mv重命名 下面在/usr/local下面创建一个 ...

  3. CentOS 7 个性化配置指南

    博客原文地址:CentOS 7 个性化配置指南 - Wind Spirit 0x00 前言 该教程主要安装了如下软件包 iptables MySQL PHP PHP 相关模块 Nginx 主要配置实现 ...

  4. UML介绍--用例图

    用例图定义:由参与者(Actor).用例(Use Case)以及它们之间的关系构成的用于描述系统功能的静态视图称为用例图. 用例图(User Case)是被称为参与者的外部用户所能观察到的系统功能的模 ...

  5. Kafka实战-数据持久化

    1.概述 经过前面Kafka实战系列的学习,我们通过学习<Kafka实战-入门>了解Kafka的应用场景和基本原理,<Kafka实战-Kafka Cluster>一文给大家分享 ...

  6. ClickHouse之初步认识

    最近在Percona的blog上看到一篇文章:Column Store Database Benchmarks: MariaDB ColumnStore vs. Clickhouse vs. Apac ...

  7. 跨域请求中预检请求options之坑

    一.前言 因为跨域请求,浏览器可能(后面讲)会发送一次options请求,如果处理不好,跨域还是会gg的. 之前很少涉及跨域,涉及也是简单请求(下面阮老师文章中区别热简单请求和复杂请求),所以基本不会 ...

  8. C#利用SerialPort控件进行串口编程小记

    一.关于DataReceive事件. 主程序必须有 outserialPort.DataReceived +=new SerialDataReceivedEventHandler(outserialP ...

  9. 定义对象为什不可以写到while语句外面。VS2017

    /// <summary> /// 绑定产品信息到网络列表 /// </summary> private void BindProduct() { Pros = new Lis ...

  10. websocket学习和群聊实现

    WebSocket协议可以实现前后端全双工通信,从而取代浪费资源的长轮询.在此协议的基础上,可以实现前后端数据.多端数据,真正的实时响应.在学习WebSocket的过程中,实现了一个简化版群聊,过程和 ...