zoukankan      html  css  js  c++  java
  • linux查看用户登录信息2-who命令

    who命令与w命令相似,但要比w命令显示更加详细的信息。
    [root@rusky opt]# man who
    WHO(1) User Commands WHO(1)

    NAME
    who - show who is logged on

    SYNOPSIS
    who [OPTION]... [ FILE | ARG1 ARG2 ]

    DESCRIPTION
    Print information about users who are currently logged in.

    -a, --all
    same as -b -d --login -p -r -t -T -u

    -b, --boot
    time of last system boot

    -d, --dead
    print dead processes

    -H, --heading
    print line of column headings

    -l, --login
    print system login processes

    --lookup
    attempt to canonicalize hostnames via DNS

    -m only hostname and user associated with stdin

    -p, --process
    print active processes spawned by init

    -q, --count
    all login names and number of users logged on

    -r, --runlevel
    print current runlevel

    -s, --short
    print only name, line, and time (default)

    -t, --time
    print last system clock change

    -T, -w, --mesg
    add user's message status as +, - or ?

    -u, --users
    list users logged in

    --message
    same as -T

    --writable
    same as -T

    --help display this help and exit

    --version
    output version information and exit
    ============
    常用who命令:

    [root@rusky opt]# who 
    root pts/0 Dec 31 14:13 (192.168.1.111)
    rusky1 pts/1 Dec 31 15:58 (192.168.1.111)
    rusky1 pts/2 Dec 31 16:00 (192.168.1.111)
    
    [root@rusky opt]# who -b               --time of last system boot
    system boot Dec 27 05:06
    
    [root@rusky opt]# who -r               ---print current runlevel
    run-level 5 Dec 27 05:06
    
    [root@rusky opt]# who -q               ---all login names and number of users logged on
    root rusky1 rusky1
    # users=3
    
    [root@rusky opt]# who -s
    root pts/0 Dec 31 14:13 (192.168.1.111)
    rusky1 pts/1 Dec 31 15:58 (192.168.1.111)
    rusky1 pts/2 Dec 31 16:00 (192.168.1.111)
    
    [root@rusky opt]# who -a
    system boot Dec 27 05:06
    run-level 5 Dec 27 05:06
    LOGIN tty3 Dec 27 05:06 3508 id=3
    LOGIN tty2 Dec 27 05:06 3506 id=2
    LOGIN tty4 Dec 27 05:06 3510 id=4
    LOGIN tty5 Dec 27 05:06 3514 id=5
    LOGIN tty6 Dec 27 05:06 3516 id=6
    root + pts/0 Dec 31 14:13 . 31733 (192.168.1.111)
    rusky1 + pts/1 Dec 31 15:58 00:33 581 (192.168.1.111)
    rusky1 + pts/2 Dec 31 16:00 00:39 581 (192.168.1.111)
    pts/3 Dec 31 16:21 1084 id=ts/3 term=0 exit=0
  • 相关阅读:
    CSS实现文字上标、下标
    Inellij idea创建javaWeb以及Servlet简单实现
    利用Intellij+MAVEN搭建Spring+Mybatis+MySql+SpringMVC项目详解
    IntelliJ IDEA使用教程一 介绍&安装&配置
    JavaScript定时器实现的原理分析
    将 Django 应用程序部署到生产服务器
    html中的table导出Excel (亲测有用(●'◡'●))
    HTML用JS导出Excel的五种方法
    JS 导出网页中Table内容到excel
    Python数据库连接池实例——PooledDB
  • 原文地址:https://www.cnblogs.com/rusking/p/4196066.html
Copyright © 2011-2022 走看看