The article directories

  • 1. Dynamically monitor processes
  • 2. Application examples

1. Dynamically monitor processes

  • Introduction:

    toppsThe commands are similar. Both are used to show the process being executed. The biggest difference between TOP and PS,Top can update running processes during execution.
  • The basic grammar
Top [option]Copy the code
  • Options:

  • The top of the default per3sUpdate once. Such as: every5sUpdate once:
top -d 5 
Copy the code
  • Top illustration

  • Zombie process: The process has died, but memory has not been freed.
  • Interactive operation instructions:

  • topThe default value is each3sRefresh a
  1. Sort by P (%CPU) (default sort) :

  2. Memory sort by M (%MEN) :

  3. Sort by N (PID) :

2. Application examples

  1. Example 1. Monitor a specific user, for example, listenxdrUser, now create a session loginxdrThe user



    top: Enter this command and press Enter to view the running process.

    u: Then enter”u“Press Enter, and then enter the user name



  2. Case 2: Terminating a specified process. For example, end the XDR user login

    top: Enter this command and press Enter to view the running process.

    k: Then enter”k“Press Enter and enter the process you want to endID no.





  3. Case 3: Specify the timing of system status updates (every10Automatic update in seconds), the default is3
top -d 10
Copy the code