Linux system administration task management and planning processes 10-

two. Static ps command to view process statistics

1. ps aux command

2 ps -elf

ps aux --no-header | more to remove the head

Output content analysis 

[top] current system time

[1:54 system has been running one hour 54 minutes]

2 users currently logged in [2] Users

load average: 0.00, 0.00, 0.00 [system load average: 1 minute, 5 five minutes, 15 minutes]

Tasks: 108 total [tasks: 108 total process]

1 running [a] process is running

107 sleepping process to sleep [107]

0 stoppd process stops [0]

[0 0 zombie zombie process (freezing process)]

Cpu (s): 0.0% us user control of CPU [percentage]

0.0% sy [kernel space occupied by the percentage of CPU]

0.0% ni [priority processes within the user process control changed occupancy percentage of CPU]

100.0% [percentage] idle CUP

MEN: 1012352K total [total physical memory 1012352K]

3424k used [used] these physical memory

352k free [free up]

Four view process information

1 pgrep # PID query information based on specific criteria

-l # displayed process name

-U # specify a specific user

-t # designated terminal

2   pstree   -aup 

Five process was started

Hand 1 Start 

(1) Reception Start

(2) Background start: end of line command added ampersand

If you do not want to call this program nohup rearmost front Add Add &

(3) jobs to view a list of background tasks simultaneously -l displays the PID number

fell into the background foreground fg #  

bg # pause the background processes running in the background adjusted

Run (4) to terminate the process

kill # terminates the specified process PID number

killall # terminate all processes with the specified name

No. 9 termination option forces

<3 pkill # terminates the corresponding process depending on the particular conditions

2 scheduled start 

(1) at the command # Set time schedule (and some not at CentOS yum command need to install or rpm)

Basic Operations

Ctrl + D to save and exit

atq # query existing time schedule

atrm # delete the first few tasks

(2) periodic task set command crontab

Edit: crontab -e -u [user name]

View: crontab -l [-u username]

Empty: crontab -r [-u username]

Note -u option is only available to the user root

###########

In fact, the role is a shell command interpreter 

Under five absolute path echo $ PATH # View commands used where

date of usage

watch -n 3 'date' # display dynamic execution time of 3 seconds

date -s "year - month - day hour: minutes: seconds" # can modify the current time

Time synchronization ntpdate pool.ntp.org #

Path 5: / usr / sbin / / usr / local / sbin / usr / bin / / usr / local / bin / root / bin  

##############

crontab task configuration format

"Points - when - Day - Month - Week" command +

Min: 0-59

When: 0-23

12:00

Day: 1-31

Month: 1-12

Week: 1-7

Guess you like

Origin www.cnblogs.com/maoyanqing/p/11353160.html