For i in a B C
Do
Echo $i
Done
!ser Historical complements
> Correct information output file
>> correct information output file, append
2> error message output file
2>> error message output file append
&>> all outputs
free-m | Grep-i Mem | awk ' {print $4,$3} '
PWD current Directory
ID Current Login User
Add a user to the group
Gpasswd-a User1 Root
CHOMD a+w (All) u+w (user) g+w (group) o+w (other users)
Specify user chmod with Setfacl/getfacl
Specify another user's permissions on a command
Visudo
For i in ' ls '
Do
echo "---> $i"
Done
Name= "Fasdfsad" (no spaces in the middle)
$ (variable)
Echo $name
Read-p "fasdfsadfs->" name
Echo $name
---------
Case $ in start)
echo "Start"
;;
Stop
echo "Stop"
;;
Esac
echo $ (($1+$2))
Expr $ + $ (must have a space)
$ #个数 $* All contents $? Last command status $ A program name
For I in $*
Do
Echo $i
Done
if [[$ = = 0]]; Then
echo "OK"
Else
echo "No"
Fi
num = ' Expr 2 + 3 + 4 '
num = ' Expr 4 \* 2 '
Echo-e recognize \ n characters-n No line break
Echo-e "\033[32;40maaaaa\033[0m"
033[foreground color, background color m
033[0m Restore System Colors
[-d/root/aaa.txt] && echo "yes"
Command shell Learning