Linux Process management command

Process management command

init: Process number is 1

Classification of processes:
     the processes associated with the terminal
     Terminal independent process

1.process state:

     D: Non interrupted sleep
     R: Run or ready
     S: Interrupted sleep
     T: Stop it
     Z:  Zombie state

     <:  High priority process
     N: Low priority process
     +: Processes in the foreground process group
     l:  Multi thread processes
     s:  The first process of the session

2.process command

ps -aux
    ps: Process State
    SysV:-
     BSD:

    a:All the processes associated with the terminal
    u:the processes created by the current user
    x:All the processes that are not related to the terminal
ps
     -elF
     -ef
     -eF

ps -o property1,property2
   eg. ps -o pid,comm,ni

pstree: Display process tree

pgrep
pidof: Find the ID number according to the process name
top:
    M: Sort the dwell memory size
    P:Sort by using the percentage of CPU
    T: Sort by the total time

    l: Whether the average load and start time are displayed
    t: Whether the display process and CPU status information
    m:Display memory related information

    c: Display complete command line information
    q: exit top
    k: To terminate a process
top 
    -d: Long latency , unit is second
    -b: Batch mode
    -n #:In batch mode,Show how many batches

Important signal:
1:SIGHUP: Let a process not restart,You can read the configuration file,And let the new configuration information come into effect
2:SIGINT: Ctrl+c: Interrupt a processes
9:SIGKILL:Kill a processes
15:SIGTERM:Terminate a process(Default signal)

kill PID

killall COMMAND

send a signal:
    by Signal number:kill -1
    by signal name:kill -SIGKILL
    by Signal for short:kill -KILL

Foreground-->Background:
      Ctrl+z: Send the job to the background in the foreground.
      COMMAND &:Let the command execute in the background.

bg:Let the background of the job to continue to run
    bg [%JOBID]

jobs: See all of the work in the background.
       job ID,not is pid
fg: The background work to the Foreground
    fg [%JOBID]

kill %JOBID: Terminate a job

vmstat:System status view command
uptime: View system load

Pingbacks are closed.

Comments are closed.