File system access list
Facl:filesystem Access Control List
Save additional access control permissions with file extensions
Setfacl
-M: Set
U:uid:perm
G:gid:perm
-X Cancel
Setfacl-x u:hive five.sh
Getfacl
Several commands:
W:show who was logged on and what they was doing
Who:show who's logged on
Every 5 seconds, check to see if Hadoop is logged in, such as logging in, showing that it is logged in, and exiting
Sleep
Whoami:print effective UserID
Last: Displays the/var/log/wtmp file, showing the user login history and System restart history
-N #: Displays information about recent # times
LASTB:/var/log/btmp file, displaying user error login attempts
-N #:
Lastlog: Displays the last successful login information for each user;
-U USERNAME: Displays recent login information for a specific user
BaseName:
$: Script path and name when executing script
Mail:
Hostname: Display host name
If the host name of the current host is empty, or (none), or ckh.com, change it to Localhost.localdomain
[-Z ' hostname '] | | [' hostname ' = = ' (none) '-o ' hostname ' = = ' ckh.com '] && hostname localhost.localdomain
Generate random numbers
random:0-32768
Random number generator: Entropy pool
/dev/random:
/dev/urandom:
Terminal type:
Console: Consoles
pty#: Physical Terminal (VGA)
tty#: Virtual Terminal (VGA)
ttys#: Serial Terminal
pts/#: Pseudo Terminal
Write a script that generates 10 random numbers using random, and finds the maximum and minimum values;
#!/bin/Bash#declare-I. max=0Declare-I. min=0 forIinch{1..Ten}; DoMyrand=$RANDOM [$I-eq1] && min=$MYRANDif[$I-le9]; Then Echo-N"$MYRAND," Else Echo "$MYRAND" fi[$MYRAND-GT $MAX] && max=$MYRAND [$MYRAND-lt $MIN] && min=$MYRAND Done
Linux--facl and Users and Linux terminals