How To Exit From top Command In Linux / Unix / BSD / OS X

I am a new Linux and Unix system users. I was told to use the top command to display and update sorted information about processes. I do not know how to exit from top command. I simply close the Terminal app. How do I exit from top command without closing my Terminal on Linux/Unix-like operating systems?

The top command displays Linux/Unix processes in your Terminal app. You get a dynamic real-time view of a running system. Use top command to see and update information about the top cpu processes on your server. To start top command, just type:
$ top
$ top [options] $ top

How to exit from top command on Linux/Unix-like system

When top is run in interactive (non-logging) mode, it is possible to control the output of top, as well as interactively send signals to processes.

Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 1m
When operating top, the two most important keys are help (h or ?) and quit (q) key.

top command option to quit session

You need to just press q (small letter q) to quit or exit from top session.

q

Alternatively, you could simply use the traditional interrupt key ^C (press CTRL+C) when you are done with top command.

Getting help with top command

To display help just press ?

?

OR

h

Related media (Video) – Exit from top command

This tutorial is also available in a quick video format:


Sorry, your browser doesn’t support HTML5 video.
(Video 01: How to exit from top command)


This entry is 1 of 4 in the Exit From Linux and Unix "app" Tutorial series. Keep reading the rest of the series:
  1. How To Exit From top Command In Linux / Unix / BSD / OS X
  2. How To Exit Vim Text Editor Command
  3. Vi / Vim: Save And Quit The Editor Command
  4. How to reload .vimrc file without restarting vim on Linux/Unix

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • aref ghobadi Aug 17, 2015 @ 9:57

    Hi
    thanks a lot

  • ken Oct 3, 2015 @ 8:28

    On Openwrt and Dd-wrt I found that only “CTRL+C” works to quit using Top “q, h, ?” does not work, on other Linux / Unix based systems I have all the commands to quit Top work “q, h, ?, and CTRL+C”, not sure why but maybe someone else will find this useful.

  • Danny Oct 18, 2016 @ 0:38

    Thanks! Such a simple yet useful tip!

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum