W
W.H.O.
WhoAmI
Last: Displays the/var/log/wtmp file showing the user login history and the system restart history
-N: Displays information about the last n times
lastb:/var/log/btmp file, displaying user error login attempt history
-N:
Lastlog: Displays the last successful logon information for each user
-U USERNAME: Displays recent login information for a specific user
BaseName $: Name does not show path
Mail: Send Email
Hostname: Display host name
Generating random numbers in random:0-32768
Random number generator: Entropy pool
/dev/random More secure
/dev/urandom more useful
For example: Write a script that generates 10 random numbers using random and finds the maximum and minimum values
#!/bin/bash
Max=0
Min=0
For ((i=1;i<=10;i++))
Do
Myrand= $RANDOM
If [$i-eq 1]
Then
min= $RANDOM
Fi
If [$i-le 9]
Then
Echo-n "$myrand,"
Else
Echo $myrand
Fi
If [$myrand-gt $MAX]
Then
max= $myrand
Fi
If [$myrand-lt $MIN]
Then
min= $myrand
Fi
Done
echo "The max number is $MAX"
echo "The min number is $MIN"
Terminal type
Console: Consoles
Pty: Physical Terminal (VGA)
TTY: Virtual terminal (VGA)
TTYs: Serial Terminal
pts/#: Pseudo Terminal
This article is from the "ngames" blog, make sure to keep this source http://ngames.blog.51cto.com/3187187/1546532
Linux terminal type, Who,last