Linux 下查看系统当前登录用户信息
当你新登录一个主机,过着管理一个主机,这时候你就需要这些命令来进行查看了:
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 下查看系统当前登录用户信息的更多相关文章
- linux 下如何查看和踢除正在登陆的其它用户 ==>Linux下用于查看系统当前登录用户信息的4种方法
在linux系统中用pkill命令踢出在线登录用户 由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍 所以需要有时踢出指定的用户 1/#who 查出当前有那些终端登录(用 ...
- Linux下用于查看系统当前登录用户信息 w命令
作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...
- CentOS下用于查看系统当前登录用户信息的4种方法
作为系统管理员,你可能经常会(在某个时候)需要查看系统中有哪些用户正在活动.有些时候,你甚至需要知道他(她)们正在做什么.本文为我们总结了4种查看系统用户信息(通过编号(ID))的方法. 1. 使用w ...
- Linux下用于查看系统当前登录用户信息的4种方法
1. 使用w命令查看登录用户正在使用的进程信息 w命令用于显示已经登录系统的用户的名称,以及他们正在做的事.该命令所使用的信息来源于/var/run/utmp文件.w命令输出的信息包括: 用户名称 用 ...
- Linux下查看/管理当前登录用户及用户操作历史记录
转载自: http://www.cnblogs.com/gaojun/archive/2013/10/24/3385885.html 一.查看及管理当前登录用户 1.使用w命令查看登录用户正在使用的进 ...
- 请给出linux中查看系统已经登录用户的命令?
w命令 第一行:当前系统运行了多久和系统负载 谁正在远程登录系统并且在干什么 [root@martin ~]# w 11:30:33 up 4 days, 18:10, 2 users, load a ...
- Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录
Linux查看系统当前登录用户的命令,top命令看到users有多个用户登录 作为系统管理员,top命令看到users有多个用户登录,会需要查看下是否被黑客进入了. 实战例子:top命令:top - ...
- Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet 查 ...
- Linux下查看Tomcat的控制台输出信息
Linux下查看Tomcat的控制台输出信息 首先使用SSH连接到数据库,然后点击window创建一个new terminal, 进入tomcat/logs/文件夹下,输出控制台信息,命令如下: cd ...
随机推荐
- NFS客户端挂载
关于NFS挂载#卸载: umount -fl /挂载名称#重新挂载:mount -t nfs -o rw,noac 10.8.16.11:/vx/SJOA-APP /挂载名称 #mount –v查看当 ...
- s3 api接口的调用
最近公司使用s3做文件存储服务器,因此在程序中需要调用s3的api,目前程序中使用了python和java版本的s3的api,简单做下记录,方便以后使用. 一.s3 api使用python版 1.安装 ...
- Spring读取外部的资源配置文件—@PropertySource和@Value实现资源文件配置
通过@PropertySource可以指定读取的配置文件,通过@Value注解获取值: @PropertySource注解主要是让Spring的Environment接口读取属性配置文件用的,标识在@ ...
- leetcode — longest-substring-without-repeating-characters
import java.util.HashSet; import java.util.Set; /** * Source : https://oj.leetcode.com/problems/long ...
- ARM64 Linux kernel virtual address space
墙外通道:http://thinkiii.blogspot.com/2014/02/arm64-linux-kernel-virtual-address-space.html Now let's ta ...
- 【API知识】ElementUI一些问题的解决方案
前言 本人并不是前端开发人员,不过前端的界面和交互也没少写.以下整理一下我在使用elementUI过程中遇到的问题和对应的解决方案. 正文 1.表格字段过长省略 elmentUI的table-colu ...
- mac使用brew安装mysql
1.安装mysql #brew install mysql 报错 Error: The following directories are not writable by your user: /us ...
- mybatis教程3(映射文件)
MyBatis 的真正强大在于它的映射语句,也是它的魔力所在.由于它的异常强大,映射器的 XML 文件就显得相对简单.如果拿它跟具有相同功能的 JDBC 代码进行对比,你会立即发现省掉了将近 95% ...
- Go语言学习笔记(二) [变量、类型、关键字]
日期:2014年7月19日 1.Go 在语法上有着类 C 的感觉.如果你希望将两个(或更多)语句放在一行书写,它们 必须用分号分隔.一般情况下,你不需要分号. 2.Go 同其他语言不同的地方在于变 ...
- Mybatis之分页插件pagehelper的简单使用
最近从家里回来之后一直在想着减肥的事情,一个月都没更新博客了,今天下午没睡午觉就想着把mybatis的分页插件了解一下,由于上个月重新恢复了系统,之前创建的项目都没了,又重新创建了一个项目. 一.创建 ...