{"id":12543,"date":"2014-09-09T13:52:57","date_gmt":"2014-09-09T11:52:57","guid":{"rendered":"https:\/\/blog.trifork.com\/?p=12543"},"modified":"2014-09-09T13:52:57","modified_gmt":"2014-09-09T11:52:57","slug":"htop-the-process-viewer-for-linux-and-mac","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/","title":{"rendered":"Htop &#8211; The process viewer for Linux and Mac"},"content":{"rendered":"<p style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" style=\"float: left;margin-right: 10px\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png\" alt=\"Htop Logo\" width=\"95\" height=\"95\" \/>In this short blog I will introduce you to a useful tool called <a href=\"http:\/\/hisham.hm\/htop\/\" target=\"_blank\" rel=\"noopener\">Htop<\/a>, a process viewer for Linux, which is also available for Mac. In the words of Htop&#8217;s author Hisham Muhammad, it aims to be a better alternative to the top program. Among other features it provides full horizontal and vertical scrolling, searching and filtering.<\/p>\n<p><!--more--><\/p>\n<h2>Getting Started with Htop<\/h2>\n<h3>Install with Apt&#8230;<\/h3>\n<p>Htop may not be installed on your system by default so you can install it with apt:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt-get install htop\n<\/pre>\n<h3>Or, build from source<\/h3>\n<p style=\"text-align: justify\">Alternatively, you can download and build the 1.0.3 version from the <a href=\"https:\/\/github.com\/hishamhm\/htop\/releases\/tag\/1.0.3\">htop Github repo<\/a>. My Ubuntu 14.4 system still uses htop 1.0.2-3 and several bugs have been fixed in 1.0.3 so let&#8217;s use the latest version. Note that you might have to install automake, libtool as well as libncurses5-dev, since htop is an ncurses application.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ wget https:\/\/github.com\/hishamhm\/htop\/archive\/1.0.3.zip\n$ unzip 1.0.3.zip\n$ cd htop-1.0.3\n$ sudo apt-get install automake libtool libncurses5-dev\n$ .\/autogen\n$ .\/configure &amp;&amp; make\n$ sudo make install\n<\/pre>\n<h3>Run!<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ htop\n<\/pre>\n<p>Here is a screenshot of htop:<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-default-screenshot1.png\"><img decoding=\"async\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-default-screenshot1-900x540.png\" alt=\"Htop screenshot\" \/><\/a><\/p>\n<h2>Tour of Htop&#8217;s features<\/h2>\n<h3>Basics<\/h3>\n<p style=\"text-align: justify\">One great feature is that you can scroll horizontally to the right to view the entire command line of every process. Also, you can use the mouse to select processes or menu items.<\/p>\n<h3>Filtering<\/h3>\n<p>Below are a few useful ways to filter processes:<\/p>\n<ul>\n<li>Filter by user: Press &#8216;u&#8217;, select a user name and hit enter<\/li>\n<li>Filter by keyword: Press F3, add a term and hit enter<\/li>\n<li>Sorting: Press F6 &#8216;Sort By&#8217; and then you can for example select on Percent memory or Percent CPU<\/li>\n<\/ul>\n<h3>Process control<\/h3>\n<p>Here are some process control features:<\/p>\n<ul>\n<li>Send signal: Press &#8216;k&#8217;, select a signal number and hit enter<\/li>\n<li>Strace: Navigate to a process and press &#8216;s&#8217;<\/li>\n<\/ul>\n<h3>Customizing<\/h3>\n<p style=\"text-align: justify\">Htop can be customized so it displays the information you want. Hit F2 for &#8216;Setup&#8217; and you can configure display options as well as the columnns it should show. Here is a screenshot of the things I customized:<\/p>\n<p><a href=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-customization-screenshot-.png\"><img decoding=\"async\" src=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-customization-screenshot--900x534.png\" alt=\"\" \/><\/a><\/p>\n<h2>Under the hood<\/h2>\n<h3>\/proc<\/h3>\n<p style=\"text-align: justify\">Htop uses the Linux <a href=\"http:\/\/www.tldp.org\/LDP\/Linux-Filesystem-Hierarchy\/html\/proc.html\">\/proc filesystem<\/a> to gather information about all processes running on a Linux host. The \/proc filesystem exposes a view of information that lives in the kernel so application programs can consume it or in some cases alter it via sysctl.<\/p>\n<h3 style=\"text-align: justify\">XDG compatibility<\/h3>\n<p style=\"text-align: justify\">Since version 1.0.2 htop is <a href=\"http:\/\/standards.freedesktop.org\/basedir-spec\/basedir-spec-latest.html\">XDG compatible<\/a>. This means that htop uses environment variables such as XDG_DATA_HOME enviromment variables for user configuration. The htop config file is stored under ~\/.config\/htop.<\/p>\n<h2 style=\"text-align: justify\">Mac support<\/h2>\n<p style=\"text-align: justify\">Even though htop was designed for Linux, the team is working on a port for the Mac, since the current version is 5 years old. A <a href=\"https:\/\/www.bountysource.com\/teams\/htop\/fundraiser\">fundraiser<\/a> is going on to help development.<\/p>\n<h2 style=\"text-align: justify\">Feedback<\/h2>\n<p style=\"text-align: justify\">As you can see htop is an easy to use process viewer. If you have any questions let me know in the comment section. Alternatively if you know more Linux tools like htop that are useful for day to day work let me know. Cheers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this short blog I will introduce you to a useful tool called Htop, a process viewer for Linux, which is also available for Mac. In the words of Htop&#8217;s author Hisham Muhammad, it aims to be a better alternative to the top program. Among other features it provides full horizontal and vertical scrolling, searching [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10],"tags":[],"class_list":["post-12543","post","type-post","status-publish","format-standard","hentry","category-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Htop - The process viewer for Linux and Mac - Trifork Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Htop - The process viewer for Linux and Mac - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"In this short blog I will introduce you to a useful tool called Htop, a process viewer for Linux, which is also available for Mac. In the words of Htop&#8217;s author Hisham Muhammad, it aims to be a better alternative to the top program. Among other features it provides full horizontal and vertical scrolling, searching [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-09T11:52:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png\" \/>\n<meta name=\"author\" content=\"frank\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"frank\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/\",\"url\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/\",\"name\":\"Htop - The process viewer for Linux and Mac - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png\",\"datePublished\":\"2014-09-09T11:52:57+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/00fad6c5829f6770345f23ccace2e54f\"},\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage\",\"url\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png\",\"contentUrl\":\"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Htop &#8211; The process viewer for Linux and Mac\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/00fad6c5829f6770345f23ccace2e54f\",\"name\":\"frank\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c39a948f2b70fa900b25dc79cde8643?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5c39a948f2b70fa900b25dc79cde8643?s=96&d=mm&r=g\",\"caption\":\"frank\"},\"url\":\"https:\/\/trifork.nl\/blog\/author\/frank\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Htop - The process viewer for Linux and Mac - Trifork Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/","og_locale":"en_US","og_type":"article","og_title":"Htop - The process viewer for Linux and Mac - Trifork Blog","og_description":"In this short blog I will introduce you to a useful tool called Htop, a process viewer for Linux, which is also available for Mac. In the words of Htop&#8217;s author Hisham Muhammad, it aims to be a better alternative to the top program. Among other features it provides full horizontal and vertical scrolling, searching [&hellip;]","og_url":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/","og_site_name":"Trifork Blog","article_published_time":"2014-09-09T11:52:57+00:00","og_image":[{"url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png","type":"","width":"","height":""}],"author":"frank","twitter_card":"summary_large_image","twitter_misc":{"Written by":"frank","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/","url":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/","name":"Htop - The process viewer for Linux and Mac - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage"},"thumbnailUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png","datePublished":"2014-09-09T11:52:57+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/00fad6c5829f6770345f23ccace2e54f"},"breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#primaryimage","url":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png","contentUrl":"https:\/\/trifork.nl\/articles\/wp-content\/uploads\/sites\/3\/2014\/08\/htop-logo.png"},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/htop-the-process-viewer-for-linux-and-mac\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Htop &#8211; The process viewer for Linux and Mac"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/00fad6c5829f6770345f23ccace2e54f","name":"frank","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5c39a948f2b70fa900b25dc79cde8643?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c39a948f2b70fa900b25dc79cde8643?s=96&d=mm&r=g","caption":"frank"},"url":"https:\/\/trifork.nl\/blog\/author\/frank\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/12543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=12543"}],"version-history":[{"count":0,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/12543\/revisions"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=12543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=12543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=12543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}