Facl:filesystem Access Control List
Save additional access control permissions with file extensions
Tom
Tom,tom Basic Group
jerry:other:r--
Chown: Only Administrators have permission
jerry:rw-
Setfacl
-M: Set, attach
U:uid:perm (permissions)
G:gid:perm
-X: Cancel
U:uid
G:gid
Getfacl
Several commands:
W
W.H.O.
Exercise: Check to see if Hadoop is logged in every 5 seconds, such as logging in, showing that it is logged in, and launching
Sleep
WhoAmI
Last xianshi/var/log/wtmp file, showing user login history and System restart history
-N #: Displays information about recent # times
Lastb,/var/log/btmp file that displays user error login attempts
-N #:
Lastlog: The last logon time per user of the current system
-u username: Displays the most recent login information for the specified user
BaseName
$: Script path and name when executing script
Mail
Hostname: Displays host name or Echo $HOSTNAME
If the host name of the current host is empty, or (none), or localhost, change it to www.baidu.com
[-Z ' hostname '] | | [' hostname ' = = ' (none) '-o ' hostname ' = = ' localhost '] && hostname www.baidu.com
Generate random numbers
random:0-32768 Echo $RANDOM
Write a script that uses random to generate 10 random numbers and find out its maximum, and minimum value
#!/bin/bash
#
Declare-i max=0
Declare-i min=0
For I in {1..10}; Do
Myrandom= $RANDOM
[$I-eq 1] && min= $MYRANDOM
If [$I-le 9]; Then
Echo-n "$MYRANDOM,"
Else
echo "$MYRANDOM"
Fi
[$MYRANDOM-gt $MAX] && max= $MYRANDOM
[$MYRANDOM-lt $MIN] && min= $MYRANDOM
Done
Echo $MAX
Echo $MIN
Random number generator:
/dev/random
/dev/urandom
Terminal type
Console: Consoles
Pty: Physical Terminal
TTY: Virtual Console
TTYs: Serial Terminal
pts/#: Pseudo Terminal
This article is from "Wilson's IT Career" blog, be sure to keep this source http://wilson20.blog.51cto.com/8385324/1426628