当前位置:网站首页>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:
边栏推荐
- Sikuli 基于图形识别的自动化测试技术
- 华为HCIE云计算之FC添加ipsan数据存储
- 数据建模已死,真的吗?
- 牛客刷题——剑指offer(第四期)
- Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
- 使用 GoogleTest 框架对 C 代码进行单元测试
- color socks problem
- UI遍历的初步尝试
- Unity editor extension interface uses List
- Entity FrameWork Core教程,从基础应用到原理实战
猜你喜欢

芯片资讯|半导体收入增长预计将放缓至 7%,蓝牙芯片需求依然稳步增长

HCIP——综合交换实验

使用 GoogleTest 框架对 C 代码进行单元测试

Unity editor extension interface uses List

ITK编译remote库

20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法

惊掉你下巴,程序员编码竟然可以被 996 指数化

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

实操|风控模型中常用的这三种预测方法与多分类场景的实现

Shader Graph学习各种特效案例
随机推荐
【LeetCode】求根节点到叶节点数字之和
UI遍历的初步尝试
万字总结:分布式系统的38个知识点
【干货】集成学习原理总结
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
3438. 数制转换
实操|风控模型中常用的这三种预测方法与多分类场景的实现
嵌入式Qt-实现两个窗口的切换
首次在我们的centos登录我们的Mysql
[论文阅读] Diverse Image-to-Image Translation via Disentangled Representations
color socks problem
Sikuli's Automated Testing Technology Based on Pattern Recognition
翻译工具-翻译工具下载批量自动一键翻译免费
Unity碰撞和触发
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
人际关系不仅要“存”,更要“激活”!
.Net面试经验总结
【ROS2原理10】Interface数据的规定
中文NER的SOTA:RICON
RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded