{"id":26,"date":"2019-08-24T21:16:00","date_gmt":"2019-08-24T21:16:00","guid":{"rendered":"http:\/\/qhris.com\/?p=26"},"modified":"2019-08-24T21:41:55","modified_gmt":"2019-08-24T21:41:55","slug":"linux-top-command","status":"publish","type":"post","link":"http:\/\/qhris.com\/?p=26","title":{"rendered":"Linux, TOP command"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">top (the UNIX process inspector) cheat sheet<\/h1>\n\n\n\n<p>This is a list of the most helpful keyboard commands to use within top.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37#the-basics\"><\/a>The basics<\/h2>\n\n\n\n<p><code>h<\/code>&nbsp;shows help on interactive commands. Also see the&nbsp;<a href=\"http:\/\/man7.org\/linux\/man-pages\/man1\/top.1.html\">top manual page<\/a><\/p>\n\n\n\n<p><code>q<\/code>&nbsp;to quit the program.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37#navigating\"><\/a>Navigating<\/h2>\n\n\n\n<p><code>Up<\/code>&nbsp;and&nbsp;<code>Down<\/code>&nbsp;to scroll through processes one by one, or&nbsp;<code>PageUp<\/code>&nbsp;and&nbsp;<code>PageDown<\/code>&nbsp;for paged navigation.<\/p>\n\n\n\n<p><code>Left<\/code>&nbsp;and&nbsp;<code>Right<\/code>&nbsp;to navigate horizontally through fields (in case you&#8217;re displaying a bunch).<\/p>\n\n\n\n<p><code>Shift+c<\/code>&nbsp;will show an index of where you are in the process list (eg 30\/300 when your cursor is on process 30 and there are 300).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37#sorting\"><\/a>Sorting<\/h2>\n\n\n\n<p><code>Shift+p<\/code>&nbsp;sort processes by CPU usage<\/p>\n\n\n\n<p><code>Shift+m<\/code>&nbsp;sort processes by memory usage<\/p>\n\n\n\n<p><code>Shift+r<\/code>&nbsp;reverse sort order<\/p>\n\n\n\n<p>Sort on any field: Press&nbsp;<code>f<\/code>&nbsp;to bring up the Field Management menu. Select the field to sort on, press&nbsp;<code>s<\/code>&nbsp;and then&nbsp;<code>Escape<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37#searching\"><\/a>Searching<\/h2>\n\n\n\n<p><code>Shift+l<\/code>&nbsp;search for a string and highlights all occurences<\/p>\n\n\n\n<p><code>o<\/code>&nbsp;add a filter to limit which processes are displayed. A filter takes the format&nbsp;<code>{field name}{comparator}{value}<\/code>. For example, to see only processes owned by my user, I would add a filter&nbsp;<code>USER=eric<\/code>.<\/p>\n\n\n\n<p><code>Ctrl+o<\/code>&nbsp;view active filters.<\/p>\n\n\n\n<p><code>=<\/code>&nbsp;clear all filters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37#other-stuff\"><\/a>Other stuff<\/h2>\n\n\n\n<p><code>m<\/code>&nbsp;switches memory views between the list of metrics and graph view.<\/p>\n\n\n\n<p><code>k<\/code>&nbsp;kill a process<\/p>\n\n\n\n<p><code>d<\/code>&nbsp;set the refresh rate (in seconds)<\/p>\n\n\n\n<p><code>Shift+w<\/code>&nbsp;saves the settings you&#8217;ve configured while running top to a file (<code>.toprc<\/code>) so they persist next time you use it.<\/p>\n\n\n\n<p><code>Shift+e<\/code>&nbsp;toggle the scale of memory metrics (between kilobytes and megabytes etc.) in the system memory summary, and&nbsp;<code>e<\/code>&nbsp;toggles the scale of memory metrics in the process list. The default is kilobytes, I find megabytes a useful level.<\/p>\n\n\n\n<p>Copied from <a href=\"https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37\">https:\/\/gist.github.com\/ericandrewlewis\/4983670c508b2f6b181703df43438c37<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>top (the UNIX process inspector) cheat sheet This is a list of the most helpful keyboard commands to use within top. The basics h&nbsp;shows help on interactive commands. Also see the&nbsp;top manual page q&nbsp;to quit the program. Navigating Up&nbsp;and&nbsp;Down&nbsp;to scroll through processes one by one, or&nbsp;PageUp&nbsp;and&nbsp;PageDown&nbsp;for paged navigation. Left&nbsp;and&nbsp;Right&nbsp;to navigate horizontally through fields (in case<\/p>\n<div><a class=\"btn-filled btn\" href=\"http:\/\/qhris.com\/?p=26\" title=\"Linux, TOP command\">Read More<\/a><\/div>\n","protected":false},"author":1,"featured_media":38,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"http:\/\/qhris.com\/wp-content\/uploads\/2019\/08\/Matrix-look-02.png","_links":{"self":[{"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/posts\/26"}],"collection":[{"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/qhris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26"}],"version-history":[{"count":4,"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":36,"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/posts\/26\/revisions\/36"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/qhris.com\/index.php?rest_route=\/wp\/v2\/media\/38"}],"wp:attachment":[{"href":"http:\/\/qhris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qhris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qhris.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}