1. 获取登录信息 - w / who / last/ lastb

      1. 23:31:16 up 12:16, 2 users, load average: 0.00, 0.01, 0.05
      2. USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
      3. root pts/0 182.139.66.250 23:03 4.00s 0.02s 0.00s w
      4. jackfrue pts/1 182.139.66.250 23:26 3:56 0.00s 0.00s -bash
      5. [root ~]# who
      6. root pts/0 2018-04-12 23:03 (182.139.66.250)
      7. jackfrued pts/1 2018-04-12 23:26 (182.139.66.250)
      8. [root ~]# who am i
      9. root pts/0 2018-04-12 23:03 (182.139.66.250)
      10. [root ~]# who mom likes
      11. root pts/0 2018-04-12 23:03 (182.139.66.250)
      12. [root ~]# last
      13. root pts/0 117.136.63.184 Sun May 26 18:57 still logged in
      14. reboot system boot 3.10.0-957.10.1. Mon May 27 02:52 - 19:10 (-7:-42)
      15. root pts/4 117.136.63.184 Sun May 26 18:51 - crash (08:01)
      16. root pts/4 117.136.63.184 Sun May 26 18:49 - 18:49 (00:00)
      17. root pts/3 117.136.63.183 Sun May 26 18:35 - crash (08:17)
      18. root pts/2 117.136.63.183 Sun May 26 18:34 - crash (08:17)
      19. root pts/0 117.136.63.183 Sun May 26 18:10 - crash (08:42)
    2. 查看自己使用的Shell - ps

      Shell也被称为“壳”或“壳程序”,它是用户与操作系统内核交流的翻译官,简单的说就是人与计算机交互的界面和接口。目前很多Linux系统默认的Shell都是bash(Bourne Again SHell),因为它可以使用tab键进行命令和路径补全、可以保存历史命令、可以方便的配置环境变量以及执行批处理操作。

      1. [root ~]# ps
      2. PID TTY TIME CMD
      3. 3531 pts/0 00:00:00 bash
      4. 3553 pts/0 00:00:00 ps
    3. 查看帮助文档 - man / info / —help / apropos

      1. [root@izwz97tbgo9lkabnat2lo8z ~]# ps --help
      2. Usage:
      3. Try 'ps --help <simple|list|output|threads|misc|all>'
      4. or 'ps --help <s|l|o|t|m|a>'
      5. for additional help text.
      6. For more details see ps(1).
      7. [root@izwz97tbgo9lkabnat2lo8z ~]# man ps
      8. PS(1) User Commands PS(1)
      9. NAME
      10. ps - report a snapshot of the current processes.
      11. SYNOPSIS
      12. ps [options]
      13. DESCRIPTION
      14. ...
    4. 查看系统和主机名 - uname / hostname

      1. [root@izwz97tbgo9lkabnat2lo8z ~]# uname
      2. Linux
      3. [root@izwz97tbgo9lkabnat2lo8z ~]# hostname
      4. izwz97tbgo9lkabnat2lo8z
      5. [root@iZwz97tbgo9lkabnat2lo8Z ~]# cat /etc/centos-release
      6. CentOS Linux release 7.6.1810 (Core)
    5. 时间和日期 - date / cal

      1. Shutdown scheduled for Sun 2019-05-26 19:34:27 CST, use 'shutdown -c' to cancel.
      2. [root ~]#
      3. Broadcast message from root (Sun 2019-05-26 19:29:27 CST):
      4. The system is going down for power-off at Sun 2019-05-26 19:34:27 CST!
      5. [root ~]# shutdown -c
      6. Broadcast message from root (Sun 2019-05-26 19:30:22 CST):
      7. The system shutdown has been cancelled at Sun 2019-05-26 19:31:22 CST!
      8. [root ~]# shutdown -r 23:58
      9. Shutdown scheduled for Sun 2019-05-26 23:58:00 CST, use 'shutdown -c' to cancel.
      10. [root ~]# shutdown -c
      11. Broadcast message from root (Sun 2019-05-26 19:31:06 CST):
      12. The system shutdown has been cancelled at Sun 2019-05-26 19:32:06 CST!
    6. 退出登录 - exit / logout

    7. 查看历史命令 - history

      1. [root@iZwz97tbgo9lkabnat2lo8Z ~]# history
      2. ...
      3. 452 ls
      4. 453 cd Python-3.6.5/
      5. 454 clear
      6. 455 history
      7. [root@iZwz97tbgo9lkabnat2lo8Z ~]# !454