English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux top command

Linux Command大全

The Linux top command is used to display the dynamic of processes in real time.

Usage permission: All users.

Grammar

top [-[d delay] [q] [c] [S] [s] [i] [n] [b]

Parameter Description:

  • d : Change the display update speed, or press s in the interactive command line (interactive command)
  • q : No delay in display speed, if the user has superuser privileges, top will execute with the highest priority
  • c : Switch display mode, there are two modes, one is to display only the name of the executable file, and the other is to display the complete path and name
  • S : Cumulative mode, accumulates the CPU time of completed or disappeared child processes (dead child process)
  • s : Safe mode, cancels interactive commands, avoids potential risks
  • i : Do not display any idle (idle) or zombie (zombie) processes
  • n : Number of updates, top will exit after completion
  • b : Batch file mode, used with the "n" parameter, can be used to output the results of top to a file

Online Examples

Display process information

# top

Display complete command

# top -c

Display program information in batch processing mode

# top -b

Display program information in cumulative mode

# top -S

Set the number of information updates

top -n 2
//Indicates the update will stop after two updates

Set the information update time

# top -d 3
//Indicates the update cycle is3Seconds

Display specified process information

# top -p 139
//Display process number139Process information, CPU, memory usage rate, etc.

Exit after displaying updates ten times

top -n 10

Users will not be able to use interactive commands to issue commands to the process

top -s

Linux Command大全