gtop: Awesome system monitoring dashboard for Linux/macOS Unix terminal

12-06 16:32

I like htop interactive process viewer. Recently I found another one called gtop. It is similar to top, but fancier. Let us see how to install and use gtop on a Linux or macOS Unix based system.

Installation

First you need to install npm using apt command /apt-get command on an Ubuntu or Debian based system:

$ sudo apt install npm nodejs

Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gyp javascript-common libicu55 libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libssl-dev libssl-doc libuv1 libuv1-dev node-abbrev
  node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore
  node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid
  node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar
  node-tunnel-agent node-underscore node-which nodejs nodejs-dev python python-minimal python-pkg-resources python2.7 python2.7-minimal zlib1g-dev
Suggested packages:
  apache2 | lighttpd | httpd node-hawk node-aws-sign node-oauth-sign node-http-signature debhelper python-doc python-tk python-setuptools python2.7-doc binfmt-support
The following NEW packages will be installed:
  gyp javascript-common libicu55 libjs-inherits libjs-jquery libjs-node-uuid libjs-underscore libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libssl-dev libssl-doc libuv1 libuv1-dev node-abbrev
  node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore
  node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid
  node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar
  node-tunnel-agent node-underscore node-which nodejs nodejs-dev npm python python-minimal python-pkg-resources python2.7 python2.7-minimal zlib1g-dev
0 upgraded, 69 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.2 MB of archives.
After this operation, 88.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.2 [338 kB]

A note about CentOS/RHEL 7 users

If you are using a RHEL/CentOS Linux 7, first install a package named epel-release and followed by nodejs and npm using theyum command:

# yum install epel-release
 # yum install nodejs npm

A note about Fedora Linux users

If you are using a Fedora Linux, install nodejs and npm using the dnf command:

$ sudo dnf install epel-release
 $ sudo dnf yum install nodejs npm

A note about macOS Unix users

Type the following brew command:

$ brew install node

Installing gtop

To install gtop, type the following command:

npm install gtop -g

Sample outputs:

/usr/local/bin/gtop -> /usr/local/lib/node_modules/gtop/bin/gtop
/usr/local/lib
└─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="1374677c6353233d223d26">[email protected]</a> 
  ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="94f6f8f1e7e7f1f0d4a4baa5baaca5">[email protected]</a> 
  ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="e0828c8593938584cd838f8e94928982a0d4ced8ced5">[email protected]</a> 
  │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="a0c1ced3c98dd4c5d2cde0908e908e92">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="c6a5aea7aaad86f7e8f7e8f5">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="badbd4c9d397c9cec3d6dfc9fa889488948b">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="462335252736236b3532342f28216b342321233e36067768766873">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="a2cac3d18fc3ccd1cbe2908c928c92">[email protected]</a> 
  │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="85f6f0f5f5eaf7f1f6a8e6eae9eaf7c5b7abb5abb5">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="9afee8fbedf3f6f6ffb7f9fbf4ecfbe9b7f8f6ffe9e9fffeb7f9f5f4eee8f3f8daaab4abb4a9">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="1e7c6c7b6d7b70767f735e2e302e302d">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="b0d4c2d1c7d9dcdcd59dd2dcd5c3c3d5d49dd3dfdec4c2d9d2f0819e809e80">[email protected]</a> 
  │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="d4b3b8f9b9b5a0a6bdac94e6fae0fae4">[email protected]</a> 
  │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="a7cbc8c3c6d4cfe7938996908993">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="0d606c7d206e6c637b6c7e4d3d233c2338">[email protected]</a> 
  │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="542c3938663e2714647a607a656d">[email protected]</a> 
  │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="681b09102859465a465c">[email protected]</a> 
  │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="8bf3e6e7e9fee2e7efeef9cbb2a5bba5bf">[email protected]</a> 
  │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="204d41524b454460100e130e17">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="c8a5a9baa3adace5bcadbaa5a1a6a9a488f9e6ffe6f8">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="16757764727f78777a562738263826">[email protected]</a> 
  │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="adccc3dec4cec2c1c2dfdeed9d839f839c">[email protected]</a> 
  │ │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="4f3d2a2b2a362a2b0f7e617f617e">[email protected]</a> 
  │ │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="8ce9fffcfee5e1edccbfa2bca2bc">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="2c4f404501584d4e40496c1c021f021d">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="c1a2aeadaeb3b281f0eff1eff2">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="5d3132393c2e35733c2e2e343a331d69736f736d">[email protected]</a> 
  │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="cba5a4afaee6aea6a4a1a28bfae5f3e5fa">[email protected]</a> 
  │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="4f23202b2e3c27613b202e3d3d2e360f7b617b617f">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="e58880888a979cc896919780848896a5d5cbd4cbd7">[email protected]</a> 
  │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="e29087838683808e87cf91969087838fa2d3ccd2ccd1d6">[email protected]</a> 
  │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="62010d10074f17160b0e4f0b1122534c524c50">[email protected]</a> 
  │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="791017111c0b100d0a394b5749574a">[email protected]</a> 
  │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="c3aab0a2b1b1a2ba83f3edf3edf2">[email protected]</a> 
  │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="027176706b6c655d6667616d66677042322c33322c3133">[email protected]</a> 
  │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="3f525a52504d464c4b4d5a5e527f0f110c110e">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="7d0d141e09080f185009081f183d4d534d5349">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="482a3d2e2e2d3a3b087866796679">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="e1828980938ca1d1cfd0cfd3">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="026774676c762f71767067636f42322c3b2c3a">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="e28d92968b8f8b9196a2d2ccd0ccda">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="ff908f8b9692968c8bbfcfd1ccd1c8">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="b3c4dcc1d7c4c1d2c3f3839d839d80">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="b7c7d9d09addc4f78799869986">[email protected]</a> 
  │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="a6d4c3d7d3c3d5d2e694889f88949695">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="c0b2a5b1b5a5b3b480f2eef8f3eef0">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="0b6a7c782678626c65394b3b253c253b">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="0e6f797d3a4e3f2038203e">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="4b282a382e272e38380b7b657a79657b">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="2c4f43414e45424948015f585e494d416c1d021c0219">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="d7b3b2bbb6aeb2b3faa4a3a5b2b6ba97e6f9e7f9e7">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="61041915040f0521524f514f50">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="d9bfb6abbcafbcabf4b8bebcb7ad99e9f7eff7e8">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="264049544b0b42475247661408150817">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="ee8f9d97808d85879aaedec0dac0de">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="056d6477287364696c6164716a7745302b352b36">[email protected]</a> 
  │ │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="e7868d91a7d2c9d2c9d6">[email protected]</a> 
  │ │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="4b28240b7f657d657b">[email protected]</a> 
  │ │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="d0b6b1a3a4fdb4b5b5a0fdb5a1a5b1bc90e1fee0fee0">[email protected]</a> 
  │ │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="37515644431a5d4458591a444356555b521a4443455e59505e514e770519071907">[email protected]</a> 
  │ │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="305a435f5e1d435358555d511d444251465542435570001e031e01">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="b2dad3c09fc1d1dad7dfd3f2809c829c82">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="99f1f8eef2d9afb7a9b7ab">[email protected]</a> 
  │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="a9cbc6c6c4e99d879a8798">[email protected]</a> 
  │ │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="7516070c05011c19100635465b445b47">[email protected]</a> 
  │ │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="9cfef3f3f1dca9b2aeb2ac">[email protected]</a> 
  │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="e880878d83a8dcc6dac6d8">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="f3809d8783b3c1ddc2ddc3">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="e48c909094c9978d838a8590919681a4d5cad6cad4">[email protected]</a> 
  │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="c9a8babaacbbbde4b9a5bcba89f8e7f9e7f9">[email protected]</a> 
  │ │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="f59f8685879c98b5c4dbc1dbc4">[email protected]</a> 
  │ │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="c7a2bfb3b4b7b5aea9b3a187f6e9f4e9f7">[email protected]</a> 
  │ │ │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="c8a2bba7a6e5bbaba0ada5a988f8e6fae6fb">[email protected]</a> 
  │ │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="a8decddadac7dae8998699988698">[email protected]</a> 
  │ │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="7e0d0d160e153e4f504f4d504f">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="6f0e1c015e2f5f415d415c">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="680a0b1a11181c45180a030c0e285946584659">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="89ede8fae1ede8fae1c9b8a7b8bda7b8">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="7d181e1e50170e1f133d4d534c534c">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="b3d4d6c7c3d2c0c0f3839d829d84">[email protected]</a> 
  │ │ │   ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="b5dfc6d7dbf5859b849b84">[email protected]</a> 
  │ │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="5420233131203a35373814647a65607a61">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="157c6638616c657071746767746c55243b253b25">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="8ee7fdfdfafcebefe3cebea0bfa0bc">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="7b1108141556080f0912151c121d0256081a1d1e3b4e554b554a">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="036e6a6e662e777a73667043312d322d3234">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="93fefafef6bef7f1d3a2bda0a3bda3">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="620d0317160a4f110b050c22524c5a4c50">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="4e3e2b3c28213c232f202d2b632021390e7c607f607e">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="63121023554d564d52">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="99eaf8fffcb4fbecfffffcebd9acb7a8b7a8">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="7e0d0a0c1710190d0a0c1b1f133e4e504e504b">[email protected]</a> 
  │ │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="16627963717e3b7579797d7f73562438253825">[email protected]</a> 
  │ │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="3343465d4a505c575673021d071d02">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="2753524949424b0a4640424953671709110917">[email protected]</a> 
  │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="8bfefee2efcbb8a5baa5bb">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="cfbcbfaebda4a3a6a1aa8fffe1fee1fd">[email protected]</a> 
  │ │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="0f676a7d6a4f3f213f213d">[email protected]</a> 
  │ │ └─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="7e10110e0a3e4c504f504c">[email protected]</a> 
  │ │   └── <a href="/cdn-cgi/l/email-protection" data-cfemail="b3d2d1d1c1d6c5f3829d829d82">[email protected]</a> 
  │ ├─┬ <a href="/cdn-cgi/l/email-protection" data-cfemail="d8abacaab1a8f5b9b6abb198ebf6e8f6e9">[email protected]</a> 
  │ │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="74151a071d59061113110c34465a455a45">[email protected]</a> 
  │ ├── <a href="/cdn-cgi/l/email-protection" data-cfemail="7a0e1f081757191b140c1b093a4a544a544f">[email protected]</a> 
  │ └── <a href="/cdn-cgi/l/email-protection" data-cfemail="a0d8929596e0908e908e92">[email protected]</a> 
  └── <a href="/cdn-cgi/l/email-protection" data-cfemail="1c6f656f68797175727a736e717d687573725c2f322f2f3224">[email protected]</a>

Usage

Simply type the following command:

gtop

OR

nodejs /usr/local/bin/gtop

Sample outputs:

Fig.01: gtop in action

You can sort the process table by pressing the following keys:

  1. Press p to sort by process ID (PID) .
  2. Press c to sort byCPU usage.
  3. Press m to sort bymemory usage.

Even though gtop is pretty fancy. I recommendhtop tool oratop utility or top command only for server usage.

原文链接:https://www.cyberciti.biz/howto/gtop-awesome-system-monitoring-dashboard-for-terminal/?utm_source=tuicool&utm_medium=referral
标签: Linux Unix MacOS
© 2014 TuiCode, Inc.