当前位置:网站首页>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:
边栏推荐
- 具有多孔光纤的偏振分束器
- 【报错】ModuleNotFoundError: No module named ‘paramiko‘
- 以太网PHY芯片LAN8720A芯片研究
- SonarQube升级记录:7.8->7.9->8.9
- 【UNR #6 C】稳健型选手(分治)(主席树)(二分)
- Solidity最强对手:MOVE语言及新公链崛起
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
- 跳房子游戏
- RESOURCE_EXHAUSTED: etcdserver: mvcc: database space exceeded
- Web性能测试模型小结
猜你喜欢
随机推荐
力扣每日一题-第51天-744. 寻找比目标字母大的最小字母
多线程之享元模式和final原理
【kali-密码攻击】(5.1.2)密码在线破解:Medusa
Summary of Web Performance Testing Models
微信小程序tab切换时保存checkbox状态
DALL·E-2是如何工作的以及部署自己的DALL·E模型
多线程之自定义线程池
[网鼎杯 2020 青龙组]AreUSerialz
mstsc/Mstsc (Microsoft terminal services client)远程桌面连接
egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
Sikuli's Automated Testing Technology Based on Pattern Recognition
hopscotch game
对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告
使用 GoogleTest 框架对 C 代码进行单元测试
卷积神经网络识别验证码
y92.第六章 微服务、服务网格及Envoy实战 -- Envoy基础(三)
用于X射线光学器件的哈特曼波前传感器
shell指定参数名传参
Janus实际生产案例
这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!