代码改变世界

进程管理

2023-03-29 17:16  @学无止境  阅读(15)  评论(0编辑  收藏  举报

1、任务调度进程 crontab

cat /etc/crontab

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
*/1 * * * * root echo "hello world"   //每分钟执行

2、查看进程

  ps -ef  |grep ***

  ps -auxf  |grep ***

  pstree root

  top

  lsof 

  pgrep -lo httpd

3、结束进程