当前位置:网站首页>Process management and task management
Process management and task management
2022-08-10 02:32:00 【sologuai】
1. View process information
1. The ps command to view the process statically
Common options:
When directly executing the ps command without any options, only the processes opened in the current user session will be displayed
- View the current system process

STAT:
D: Sleep state that cannot be awakened;
R:running status;
S: in sleep state, can be woken up;
T: stop state, it may be suspended in the background or the process is in a trace debugging state;
Z: Zombie factory process, the process has been terminated, but some programs are still in memory, but its parent process cannot terminate it normally
Zombie process: A zombie process is when the child process ends before the parent process, and the parent process does not recycle the child process and release the resources occupied by the child process. At this time, the child process will become a zombie process.If the parent process exits first, the child process is taken over by init, and after the child process exits, init will reclaim the related resources occupied by it.
2.ps -elf command

3.ps-T view thread
View current thread

4. Dynamic view top command

View current thread

5.pgrep command - query process PID information according to specific conditions
Display the process name and its process ID of the process that contains the log

6.pstree command view process tree

7. Manual start process of control process
Foreground startup: the program directly executed by the user entering a command;
Start in the background: add an "&" sign at the end of the command line
When using the cp command to create an image file from a CD, it takes a long time to copy a lot of data, so you can combine the "&" symbol to run the copy operation in the background, so that the user can continue to execute other commandsAction
8. Front-end and back-end scheduling of processes
Ctrl + Z key combination: Suspend the current process, that is, transfer to the background and stop execution
jobs command: view the list of tasks in the background
fg command: restore the background process to the foreground, you can specify the task sequence number
9. Terminate the process
Ctrl + C: Interrupt the command being executed
kill, killall command
kill is used to kill the process with the specified PID number
killall is used to kill all processes associated with the specified name
-9 option for force termination
Pkill command two options
Second, scheduled task management
1. Use the at command to set a one-time scheduled task
at [HH:MM] [yyyy-mm-dd] # execute today without the year, month and dayatq #View unexecuted one-time scheduled tasksatrm #delete task
2. Use the crontab command to set up periodic scheduled tasks
crontab command
Repeatedly execute the command operation specified by the user according to the preset time period (minutes, hours, days....)
It belongs to a periodic scheduled task
Edit scheduled taskscrontab -e [-u username]View scheduled taskscrontab -l [-u username] delete scheduled taskcrontab -r [-u username]
Each asterisk (*) represents a different concept of time:
Special representation of time values:
边栏推荐
猜你喜欢

type-C 边充电边听歌(OTG) PD芯片方案,LDR6028 PD充电加OTG方案

不是吧,连公司里的卷王写代码都复制粘贴,这合理?

这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!

商业模式及其 SubDAO 深入研究

首次在我们的centos登录我们的Mysql

unity编辑器扩展界面使用 List

sql实战积累

hopscotch game

color socks problem

Not, even the volume of the king to write code in the company are copying and pasting it reasonable?
随机推荐
web开发概述
力扣每日一题-第51天-744. 寻找比目标字母大的最小字母
【Grpc】报错:status = StatusCode.UNIMPLEMENTED details = ““
【wpf】拖拽的简单实现
Unity reports Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe’ code” in Pla
[LeetCode] Find the sum of the numbers from the root node to the leaf node
谷歌翻译器-谷歌翻译器软件批量自动翻译
牛客刷题——剑指offer(第四期)
这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
阿里云OSS文件上传
C# 四舍五入 MidpointRounding.AwayFromZero
MySQL最大连接数限制如何修改
odoo公用变量或数组的使用
Qt的pro文件递归搜寻添加文件
DALL·E-2是如何工作的以及部署自己的DALL·E模型
按钮倒计时提醒
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
Unity顶点动画
什么是一网统管?终于有人讲明白了
微透镜阵列的高级模拟