Process and scheduled task management
Process and Scheduled Tasks list
1. View the process
1.1 Relationship of procedures and processes
Program: Save the hard disk, CD and other media executable code and data, is a static saved code
Process: Program code running in CPU and memory is code that executes dynamically
Parent, child process: each process can create one or more processes
1.2 Viewing process statistics at rest
Ps
PS aux: Show process information as a simple list
A: Displays all process information under the current terminal, including the processes of other users
U: Output process information in a user-oriented format
X: Displays process information for the current user under all terminals
Ps-elf: Displays process information in a long format and contains richer content
-E: Displays all process information in the system
-L: Display process information in long format
-F: Displaying process information using the full format
When you directly execute a PS command without any options, only the processes that are open in the current user session are displayed
The number of processes running in the system can be combined with a "| grep option uses the
Pgrep
Query process PID information based on specific criteria
-L: Show process name
-U: Specify a specific user
-T: Specify terminal
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/83/6C/wKioL1dzO7vDOwiTAACe18FVBVE837.png "title=" 1.png " alt= "Wkiol1dzo7vdowitaace18fvbve837.png"/>
Pstree
List process information in a tree-shaped structure
-A: Show full information
-U: List the corresponding user name
- P: list the corresponding PID
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/83/6D/wKiom1dzO8mzlsMJAACMu4MfOnc937.png "titl E= "2.png" alt= "Wkiom1dzo8mzlsmjaacmu4mfonc937.png"/>
1.3 Viewing process statistics dynamically
Top: The current terminal in a full-screen interactive interface to display the process ranking, and tracking including CPU, memory and other system resource consumption, by default, every three seconds to refresh
Sort
P: Sort the list of processes based on CPU usage
M: Sort based on memory usage
N: Sort by start time
H: or Top program's online Help information
Q: Exit Top program
K, and then enter the PID number to kill a process
1.4 Control Process
Process start Mode
Manual start
Foreground start: User input command, execute program directly
Background start: Add the "&" symbol at the end of the command line
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/83/6C/wKioL1dzO9iR5SjyAADkUmu5LOk699.png "titl E= "3.png" alt= "Wkiol1dzo9ir5sjyaadkumu5lok699.png"/>
Scheduled start
Use the AT command to set up a one-time scheduled task
Script Name:/ETC/INIT.D/ATD
Formatting: at [hh:mm] [YYYY-MM-DD]
Submit Task: Ctrl+d
View the list of non-performing tasks: ATQ
Delete Second task: ATRM 2
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/83/6C/wKioL1dzO-7DYA1pAAPZXoLQ6Ls335.png-wh_500x0-wm_3 -wmp_4-s_1010022155.png "style=" Float:none; "title=" 4.png "alt=" Wkiol1dzo-7dya1paapzxolq6ls335.png-wh_50 "/>
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/83/6C/wKioL1dzO_DBnuHdAAL5pMzMkxI688.png-wh_500x0-wm_3 -wmp_4-s_1835469402.png "style=" Float:none; "title=" 5.png "alt=" Wkiol1dzo_dbnuhdaal5pmzmkxi688.png-wh_50 "/>
Set up recurring scheduled tasks using the crontab command
Follow the pre-set time period (minutes, hours, days ...)
Service Script Name:/etc/init.d/crond
Global configuration file:/etc/crontab
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/83/6C/wKioL1dzPBuTEmn6AAJ6h0eJASk650.png "title=" 6.png " alt= "Wkiol1dzpbutemn6aaj6h0ejask650.png"/>
system default settings, located in directory:/etc/cron.*
User-defined settings:/var/spool/cron/user name
Manage Cron Scheduled Tasks
Edit Scheduled Task: Crontab-e [-u user Name]
View Scheduled Tasks: Crontab-l [-u user Name]
Delete Scheduled Task: Crontab-r [-u user Name]
Crontab the format of the task configuration
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/83/6D/wKiom1dzPDDhmiLuAAP59NBjUlA077.png "title=" 7.png " alt= "Wkiom1dzpddhmiluaap59nbjula077.png"/>
A special method of representing time values
* Indicates any time within the range
, which represents multiple discontinuous points of time for the interval
-Represents a continuous range of time
/Specify the time frequency of the interval
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/83/6C/wKioL1dzPELA5FlHAAGB14BnMHQ755.png "style=" float: none; "title=" 8.png "alt=" Wkiol1dzpela5flhaagb14bnmhq755.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/83/6D/wKiom1dzPE3jeJCRAAP00LVXHvE662.png "style=" float: none; "title=" 9.png "alt=" Wkiom1dzpe3jejcraap00lvxhve662.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/83/6D/wKiom1dzPE7SWD9HAAJ52m4n2Oo009.png "style=" float: none; "title=" 10.png "alt=" Wkiom1dzpe7swd9haaj52m4n2oo009.png "/>
Front and back scheduling of processes
CTRL + Z: suspends the current process and moves into the background and stops execution
Jobs: View a list of tasks in the background (+ indicates the most recent task that was put in the background-the task that the second person put to the background)
FG: Restore the background process to the foreground to run, you can specify the task sequence number
BG: Background paused task resumes running, specifying task sequence number
To terminate the running of a process
CTRL + C: Interrupt the command being executed
Kill: The process used to terminate the specified PID number
Killall: Used to terminate all processes of the specified name
-9: Forced termination, kernel Force shutdown process (default to 15 for this parameter, normal exit)
Pkill: Terminates the corresponding process according to certain conditions
-U: Terminates the process based on the user name the process belongs to
-T: Terminates the process based on the terminal where the process resides 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/83/6C/wKioL1dzPGbjL1G4AAF9Ks9U7Vk210.png "titl E= "11.png" alt= "Wkiol1dzpgbjl1g4aaf9ks9u7vk210.png"/>
Process and scheduled task management