Linux terminal and command supplement, Linux terminal command supplement
Whoami: print a valid user ID
Who: displays which users are logged on to the system
Who-r displays the running level
Who-H display field name
W: Show who has logged on and what are they doing
Last: the/var/log/wtmp file is displayed. The user logon history and system restart history are displayed.
-N #: displays the latest # related information
Lastb:/var/tmp/btmp, displays the user's wrong Logon Attempt
-N #: Only displays the latest # related information
Lastlog: displays the last successful logon information for each user.
-U USERNAME: displays the recent logon information of a specific user.
Basename: get the file name in a path
$0: script path and name during Script Execution
Mail:
Hostname: displays the current host name.
Echo $ HOSTNAME
Generate random number:
RANDOM: 0-32768
Random number generator:
/Dev/random: If the entropy value is null, the user process will be blocked.
/Dev/urandom: the user process is not blocked. If the entropy pool is empty, it is generated in the software mode.
Terminal type:
Console: console
Pty: Physical terminal (VGA)
Tty: virtual terminal (VGA)
Ttys: Serial Terminal
Pts/#: Pseudo Terminal