Sort out the tips for using the top command

When using the top command to monitor your system's resource usage, here are some common tips and command options:

  1. Real-time refresh frequency: By default, the top command refreshes every 3 seconds. You can use the following shortcut keys to adjust the refresh frequency:

    • "d": Manually enter the refresh interval in seconds.
    • "s": Silent mode, turns off refreshing until another key is pressed.
  2. Sorting method: Sort processes according to different resource indicators. The following are commonly used sorting shortcut keys:

    • "P": Sort by CPU usage.
    • "M": Sort by memory usage.
    • "N": Sort by PID.
    • "T": Sort by running time.
  3. Process filtering: Process filtering via command line options or interactive interface.

    • "-p": Only display the process information of the specified PID.
    • "u": Only display process information for the specified user name.
  4. Show/hide specific resource information: You can use the following shortcut keys to control showing or hiding specific resource information:

    • "l": Toggle show/hide load average and startup time.
    • "t": Toggle display/hide task and thread information.
    • "m": Toggle display/hide memory usage information.
  5. Execute commands: In the interactive interface of the top command, you can execute some commands to obtain more system information or perform other operations. Here are some commonly used commands:

    • "1": Switch to displaying detailed information for each CPU core.
    • "c": Toggle display of command line parameters.
    • "i": Toggle display of idle CPU time percentage.
  6. Exit the top command: Press the following keyboard shortcuts to exit the top command:

    • "q": Exit the top command immediately.

These tips and command options can help you better use the top command to monitor and analyze system resource usage. You can combine these options as needed to get the information you need.

Guess you like

Origin blog.csdn.net/qq_44370158/article/details/132824712