System Information UNAME-M displays the processor architecture of the machine Uname-r shows the kernel version cat/proc/cpuinfo is being used to display information about CPU info cat/proc/meminfo Verify memory usage cat/proc/swaps show which SWA P is used cat/proc/version display kernel version cat/proc/net/dev display network adapter and statistics cat/proc/mounts display loaded file system Lspci-tv list PCI device LSUSB-TV display USB device Date Display system date Cal 2016 displays 2016 calendar table Clock-w save time modification to bios get IP address ifconfig eth0 |grep "inet addr:" |awk ' {print $} ' | Cut-c 6-ifconfig | grep ' inet addr: ' | Grep-v ' 127.0.0.1′|cut-d:-f2 | awk ' {print '} ' Check the number of currently logged on users who | wc-l shutdown (System shutdown, restart, and logout) shutdown-h now shut down system (1) INIT 0 shutdown system (2) Telinit 0 Shutdown System (3) shutdown-h Hours:minutes & closed on scheduled time System shutdown-c Cancel on scheduled time shutdown system Shutdown-r now restart (1) reboot restart (2) Logout logoff Check that DNS server is working properly, Take 61.139.2.69 as an example dig www.baidu.com @61.139.2.69 View the size of the memory free-m |grep "Mem" | awk ' {print $ ' View file size and view disk usage du: file-based, statistical file size addition--is a file-oriented command that calculates the space allocated to a specified file or directory. DF: Disk-based, statistical block usage-determines the size of allocated space in the file system through unallocated space in the file system. Common commands:df-hi du-a view 80 port connections and sort Netstat-an-t | grep ": 80″|grep established | awk ' {printf '%s%s\n ", $5,$6} ' | sort log view, search Cat/var/log/rflogview/*errorsgrep-i error/var/log/messagesgrep-i fail/var/log/messagestail-f-N 2000/var/log/messages read-write character Read-n read n characters-s not echo-p display hint message-t specific time-D delimiter use Cut command to select field cut-d:-F 1,5/etc/pass The colon after the WD #-d represents the delimiter between the fields. #-f indicates which fields to take after splitting. Extract start or end lines Head-n 5/etc/passwd# displays the first five elements of the input file. tail-n 5/etc/passwd #显示输入文件的最后五行. REDIRECT Output 0: Indicates keyboard input (stdin) 1: Indicates standard output (stdout), system default is 12: Indicates error output (stderr) * 2>&1 is stderr to stdout as output * 1>&2 or >&2 is to stdout stderr as output command >/dev/null 2>&1 & == command 1>/dev/null 2>&1 &am P;1) Command: Represents a shell command or an executable program 2);: Indicates redirect to where 3)/dev/null: Empty device file for Linux 4) 2: Indicates standard error output 5) &1:& means equivalent, 2 >&1, which indicates that 2 of the output redirect equals to () &: Indicates background execution, that is, this instruction execution runs in the background in summary, this command means: Execute this program in the background, redirect error output 2 to standard output 1, and then put the standard output 1 all to/dev/ Null file, which is empty. parameter pass $ A script name $-$9 position parameter #1-#9 $ #位置参数的个数 "[email&Nbsp;protected] "All positional parameters" $* "All positional parameters $?" Returns the return value of the previous command, which can be used to check the execution result after the command is executed. $$ script Process ID (PID) parameters to determine if [expr]; then ... fi-n str: whether the string str is not empty -z str : Whether the string is empty str1 = str2 :str1 is the same as str2 str1! = STR2: str1 is different from str2 int1-eq int2 : equals int1-le int2 : Less than equals int1-ge int2 : Greater than or equal to int1-lt int2 : less than int1-gt int2 : Greater than int1-ne int2 : Not equal to-B: Block file -P: Whether the file is a named pipe -c: Character file -r: whether the file is readable -d : whether a directory *-s : whether the length of the file is not zero-e: File exists * * S: Is the socket file-F: Normal file *-x: whether the file is executable or true-G: Whether the file's SGID bit-u: Set the file's SUID bit-G: whether the file exists and is owned by the group -w: whether the file is writable, True-K: Whether the file is set to paste bit-t fd:fd is an open file descriptor that is connected to the terminal (FD defaults to 1)-O: The file exists and is owned by the user all e_noargs=65if [-z] "#" #-Z if 0 is true Print usage and error parameters then echo "Usage: ' basename $ [domain-name] '" exit $E _NOARGSFI if no parameter exists
The
Linux command learns to organize.