First, shutdown, restart
1. Turn off the machine
Shutdown option [option] ... Parameter (time) option:-R: Restart-H: Shutdown-C: Cancel the previously set restart or shutdown command-K: Send only reminder time format: default equivalent to +1hh:mm now: immediately +#: #分钟之后
2. Restart
Reboot #重启 Poweroff #直接断电拉闸
Second, time management
Date #显示当前系统时间 Date MMDDHHMM[CC]YY.SS: Set system time Date [+format]: Specify time format%Y: Year%m: Month%d: day %H: Hours%M: minutes%s: Seconds%A: Days of the week%F: year-month-day%T: When: minutes: seconds Hwclock: Show current hardware time-s,--hctosys Hardware time, calibration system time-W,--SYSTOHC to the system time, correct hardware time
Third, command aliases
Alias: Define command alias Example: Alias rm= ' Rm-i ' unalias: Undo Alias-A cancels all aliases example: Unalias RM PS: alias defined on the command line, only valid for the current shell process to be permanently valid, define the configuration file : Only for the current user: ~/.BASHRC valid for all users:/ETC/BASHRC
Iv. Command History
History: View executed commands historical!n: Execute the nth command in the past!! : Executes the previous command!-n: Executes the reciprocal nth command!$: Last parameter in the last command-D N: Delete nth command history-C: Clears the historical list
V. Echo command
Echo:echo will send the input string to standard output. Usage: echo [option] [string] option:-N: Do not wrap-e: enable \ Character interpretation function "" "(double quotes): Weak reference, variable will replace ' (single quote): Strong reference, variable will not replace (all treated as String) ' (Inverse Number): Command reference font color: # echo-e "\033[5;43;31mabc\033[0m" # echo-e "\033[display mode (optional); font background color m string \033[0m"
Linux basic commands