当前位置:网站首页>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:
边栏推荐
- 空间复杂度为O(1)的归并排序
- Initial attempt at UI traversal
- mstsc/Mstsc (Microsoft terminal services client)远程桌面连接
- RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded
- 惊掉你下巴,程序员编码竟然可以被 996 指数化
- 这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
- Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
- unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
- 首次在我们的centos上安装MySQL
- 中文NER的SOTA:RICON
猜你喜欢

高压之下,必有懦夫

Visual low-code system practice based on design draft identification

【无标题】

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

MySQL最大连接数限制如何修改

Not, even the volume of the king to write code in the company are copying and pasting it reasonable?

Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily

商业模式及其 SubDAO 深入研究

这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
![[网鼎杯 2020 青龙组]AreUSerialz](/img/33/a237185ffe0c5780432c242c36cbdc.png)
[网鼎杯 2020 青龙组]AreUSerialz
随机推荐
【UNR #6 B】机器人表演(DP)
UI遍历的初步尝试
万字总结:分布式系统的38个知识点
[论文阅读] Multimodal Unsupervised Image-to-Image Translation
Linux(Centos7)服务器中配置Mysql主从数据库,以及数据库的安装,防火墙操作
The shell specifies the parameter name to pass the parameter
【内存管理概述 Objective-C语言】
嵌入式Qt-实现两个窗口的切换
具有多孔光纤的偏振分束器
STM32F103驱动HCSR04超声波测距显示
Sikuli's Automated Testing Technology Based on Pattern Recognition
翻译工具-翻译工具下载批量自动一键翻译免费
Problems and solutions related to Chinese character set in file operations in ABAP
【ROS2原理10】Interface数据的规定
芯片资讯|半导体收入增长预计将放缓至 7%,蓝牙芯片需求依然稳步增长
牛客刷题——剑指offer(第四期)
Shader Graph学习各种特效案例
商业模式及其 SubDAO 深入研究
什么是一网统管?终于有人讲明白了
浏览器中location详解