Common basic Commands:
cd command: Change directory
CD [/path/to/somewhere]
Cd
CD ~: Back to home directory
CD ~username: Switch The home directory for the specified user
CD-: Go back to your previous directory
Related environment variables:
Pwd:
OLDPWD:
PWD command: Printing working directory
Show working directory
Ls:list
Lists the property information for a file or directory under a specified path
Metadata: Attribute Data
Data:
ls [OPTION] ... [FILE] ...
-L: Display with long format
Drwxr-xr-x 1 root root 8 08:47. cache
D: File type
Rwxr-xr-x: Permissions, Mode
1: Number of times a file has been hard linked
Root:owner, belonging to the Lord;
Root:group, genus Group
8:size, Default is byte
23 08:47 Modify Timestamp
. cache: File name
-D: Display the directory's own properties
-h:human-readable
-A: Displays all files, including. Start hidden files
.: Current Directory
..: Parent Directory
-r:reverse, Reverse display
-r:recusive, recursive
Text file view commands for the class:
Cat, TAC Command:
Cat [OPTION] ... [FILE] ...
-N:
-E:-ve
-E: Display line terminator
-V: Display nonprinting characters
File content Type view command:
File/path/to/somewhere
Echoing command: Echo
echo [OPTION] ... [ARGS] ...
-N: No line break;
-e: Allow the control to take effect;
\n:new Line
echo "$VAR _name"
Command path location View tool:
Whereis, which
Which:
which [options] [--] programname [...]
--skip-alias: Prohibit listing aliases
Whereis COMMAND:
Displays the path to the binaries, source files, and help manuals;
Time-related commands:
Rtc:realtime Clock
System clock: Systems clocks
Date: System time
Clock, Hwclock: Hardware time
Date
Date [OPTION] ... [+format]: Time display
FORMAT
%F
%d
%T
%H
%M
%s
Date [MMDDHHMM[[CC]YY][.SS]]: Time setting
Hwclock
-s:hctosys, with hardware clock as the standard, adjust the system time with the hardware;
-W:SYSTOHC, whichever is the system clock
Cal:
Cal [year]
Shutdown or restart
shutdown: Halt, Poweroff, Init 0, shutdown-h time
restart: reboot, init 6, Shutdown-r time
shutdown
shutdown [OPTIONS ...] [TIME] [WALL ...]
-R: Restart
-H: Shutdown
--no-wall
-C
Time:
+m: The corresponding operation is performed after the relative length, and the unit is minutes;
hh:mm Absolute Time
Stat
W, who, WhoAmI
About the format and usage of some Linux commands (Linux Employment Class second assignment)