[ad_1]
一世 像 htop 交互式进程查看器。 最近我发现了另一个叫做gtop的。 它类似于top,但更高级。 让我们看看如何在基于 Linux 或 macOS Unix 的系统上安装和使用 gtop。
安装
首先,您需要在基于 Ubuntu 或 Debian 的系统上使用 apt 命令/apt-get 命令安装 npm:$ sudo apt install npm nodejs
示例输出:
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 https://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.2 [338 kB]
关于 CentOS/RHEL 7 用户的说明
如果你使用的是 RHEL/CentOS Linux 7,首先安装一个名为 epel-release 的包,然后使用 yum 命令安装 nodejs 和 npm:# yum install epel-release
# yum install nodejs npm
一个关于 Fedora Linux 用户
如果您使用的是 Fedora Linux,使用 dnf 命令安装 nodejs 和 npm:$ sudo dnf install epel-release
$ sudo dnf yum install nodejs npm
关于 macOS Unix 用户的说明
首先,在 macOS 上安装 Homebrew,然后输入以下 brew 命令:$ brew install node
安装 gtop
要安装 gtop,请键入以下命令:npm install gtop -g
示例输出:
/usr/local/bin/gtop -> /usr/local/lib/node_modules/gtop/bin/gtop /usr/local/lib └─┬ [email protected] ├── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] │ │ │ └─┬ [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ ├── [email protected] │ │ │ │ ├── [email protected] │ │ │ │ ├── [email protected] │ │ │ │ └── [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ ├── [email protected] │ │ │ │ ├── [email protected] │ │ │ │ └── [email protected] │ │ │ └─┬ [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ └── [email protected] └── [email protected]
用法
只需键入以下命令:gtop
或者nodejs /usr/local/bin/gtop
示例输出:
您可以通过按以下键对过程表进行排序:
- 按 p 到 按进程 ID (PID) 排序.
- 按 c 按 CPU 使用率排序。
- 按 m 按内存使用情况排序。
尽管 gtop 很花哨。 我推荐 htop 工具或 atop 实用程序或 top 命令仅用于服务器使用。
也可以看看
- 如何在 Linux 上安装和使用 vtop 图形终端活动监视器
- 安装和使用 nmon 工具来监控 Linux 系统性能
- 每个系统管理员都应该知道的 20 个 Linux 系统监控工具
- Linux:使用 Glances Monitor 密切关注您的系统
- 参观 顶 项目页面了解更多信息。
[ad_2]