Advanced Directives
1.hostname instruction function: Operation server hostname (read settings)
Hostname output the full host name
Hostname-f to output the fully qualified domain name of the current host
2.id instruction function: View some basic information of a user (including User ID user group ID additional group ID ...) )
This directive displays the current user by default if you do not specify
Syntax: ID defaults to display information that executes the current user
Syntax: ID user name displays basic information for the specified user
Verifying User Information cat/etc/passwd
Verifying user group Information Cat/etc/group
3.whoami Command function Displays the currently logged in user name
Typically used by shell scripts to get the current log operator who is
4.PS-EF directive (emphasis)
Instruction PS to view process information for the current server
Option:-e indicates that all processes are listed
-F Show All columns
UID the user ID that the process executes
PID Process ID
PPID the process's parent process if no parent process is found the process of the program is called a zombie process
C CPU occupancy rate is in the form of percent
Stime start time of the process
TTY Terminal Equipment identification number of the device initiating the process if it is? Indicates that the process is not initiated by an end device
Time when the process was executed
CMD the process name or the corresponding path
Filter the status of the process you want to see in the PS results
Ps-ef | grep cmd name
5.top instruction function: View the server's process footprint resources
Syntax: Top (enter command) dynamic display
Q (Exit command)
The greater the priority of the PR priority, the higher the priority of the queue
VIRT virtual Memory Request 500M actually uses 320M virtual memory as 500M
RES resident Memory Request 500M actually uses 320M of virtual memory for 320M
SHR Shared Memory Request 500M actually uses 320M but it contains the call overhead for other processes
This part of the overhead is shared memory
Calculate the actual memory used by a process = resident memory-Shared memory
Men memory Occupancy Percentage
Convenient shortcut keys
M descending order of results by memory from high to low
P sort results in descending order of CPU usage from high to low
Number 1 When the server has multiple CPUs, use 1 to toggle whether to expand the display of individual CPU details
6.DU-SH directive function: View the real size of the directory
Option meaning:-s Displays the total size only
-H for display in a higher readability format
Syntax format: Du-sh directory path
7.find command function: Find files (55 parameters)
Syntax: Find path range option value
Option:-name Search by document name (fuzzy search is supported)
-type Search by Document Type "-" means that the file (replaced with F in search) "D" means a folder
Case use Find search httpd.conf
Find-name httpd.conf
Case Search all conf suffix files in the ETC directory
Find/etc-name *.conf
Case: Use Find to search all files in the SANE.D directory under the ETC directory
find/etc/sane.d/-type F
Case: Use Find to search all folders in the ETC directory
Find/etc-type D
8.service instruction (emphasis) function to control some software services start stop restart
Syntax: Service name Start/stop/restart
Apache (Web services software) service that needs to start the native installation is named httpd
Service httpd Start
Ps-ef | grep httpd
9.kill instruction (emphasis) Action: Indicates the kill process (when encountering a zombie program or some reason to close the program)
Syntax 1:skillall process name
Syntax 2:skill process PID
Case needs to kill Apache's process/
10. IFCONFIG directive (emphasis) function: For operating network card related instructions
Syntax: ifconfig
11.reboot instruction function: Restart the computer
Syntax 1:reboot restart
Syntax 2:reboot-w analog reboot, but does not restart
12.shutdown directive function: Use caution with caution in shutting down the machine
Syntax: Shutdown-h now (shut down immediately) or shutdown-h 15:25 (timed off)
If you want to cancel the shutdown schedule for the previous version of centos7.0 CTRL + C
For centos7.0 later version shutdown-c
13.uptime instruction function: Output the duration of the computer (computer from boot to present)
14.uname instruction function: Get information about the computer system
Uname get the type of operating system
UNAME-A Get all system information (type all hostname kernel version release time Open source plan)
15.NETSTAT-TNLP instruction function: View network connection Status
Option Description:
-T indicates a connection that lists only the TCP protocol
-N means converting an address from a combination of letters to an IP address, converting the protocol into a port number to display
-L means filter out "state" to list connections whose value is listen (listening)
-P shows the process PID and process name initiating the connection
16.man instruction function: Manual (manual with full Linux content)
Syntax: Man instruction name
Practice:
Linux Learning-----3