Forrest logo
back to context overview

top

List of commands for top:

  • top:ai:c7f0e Run top with the -b and -n 1 options and redirect the output to a file named top.txt
    $ top -b -n 1 > top.txt
    try on your machine
    explain this command
  • top:tldr:00c58 top: Show only processes owned by given user.
    $ top -u ${username}
    try on your machine
    explain this command
  • top:tldr:36ec1 top: Show the individual threads of a given process.
    $ top -Hp ${process_id}
    try on your machine
    explain this command
  • top:tldr:582dd top: Sort processes by a field.
    $ top -o ${field_name}
    try on your machine
    explain this command
  • top:tldr:5cd11 top: process ID).
    $ top -o mem
    try on your machine
    explain this command
  • top:tldr:706fe top: Start top sorting processes first by CPU, then by running time.
    $ top -o cpu -O time
    try on your machine
    explain this command
  • top:tldr:90df5 top: Start top displaying only processes owned by given user.
    $ top -user ${user_name}
    try on your machine
    explain this command
  • top:tldr:9652b top: Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name).
    $ top -p $(pgrep -d ',' ${process_name})
    try on your machine
    explain this command
  • top:tldr:b2835 top: Start top.
    $ top
    try on your machine
    explain this command
  • top:tldr:b80eb top: Do not show any idle or zombie processes.
    $ top -i
    try on your machine
    explain this command
  • top:tldr:d1457 top: Get help about interactive commands.
    $ ?
    try on your machine
    explain this command
back to context overview