RedHat 安装 磁盘管理工具 ncdu

这里记录一下RedHat 7 安装 linux磁盘管理工具 ncdu 

Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find
 space hogs on a remote server where you don't have an entire graphical setup 
available, but it is a useful tool even on regular desktop systems. Ncdu aims
 to be fast, simple and easy to use, and should be able to run in any minimal
 POSIX-like environment with ncurses installed.

# 用我蹩脚的英语水平简单翻译一下
# Ncdu 是一个使用 ncurses 库接口的磁盘分析工具,主要用于在无法使用图形化配置界面时,
管理和查询远程服务器的磁盘空间,但不仅仅如此,在普通的桌面级操作系统中,它也是一个很
好用的工具,Ncdu 致力于响应迅速,易于使用,且能够在任何最小类可移植操作系统环境上运行

磁盘管理工具 ncdu 是一个比较方便好用的 unix & linux 磁盘管理工具,知道了这个工具我的第一反应就是使用 yum 安装

# 使用 yum 安装 ncdu
[root@localhost Desktop]# yum install ncdu

Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
base                                                     | 3.6 kB     00:00     
extras                                                   | 2.9 kB     00:00     
updates                                                  | 2.9 kB     00:00     
No package ncdu available.
Error: Nothing to do

执行结果显示找不到安装包。 在网上检索了一下之后,表示 ncdu 无法从 yum 仓库直接下载 (如何更换免费 yum 源 请参考 链接),这里记录一下安装过程

1. 首先下载最新的安装包

ncdu 官方网站上,复制最新的下载的连接,使用 wget 指令下载压缩包

# 下载连接仅供参考,读者在进行下载的时候可能版本号不同
# 当然如果您选择的是旧版本或者其他的不同版本,下载链接也会不同
[root@localhost ~]# wget https://dev.yorhel.nl/download/ncdu-1.15.1.tar.gz

2.解压压缩包,进入文件夹中

# 解压
[root@localhost ~]# tar zxvf ncdu-1.15.1.tar.gz 
# 进入文件夹
[root@localhost ~]# cd ncdu-1.15.1/
# 运行配置脚本
[root@localhost ncdu-1.15.1]# ./configure --prefix=/usr

 3.配置过程中报错的解决(如果没有报错请跳过此步骤)

checking for ncurses.h... no
configure: error: required header file not found

遇到此错误,需要安装 curses  库文件

[root@localhost ~]# yum install ncurses ncurses-devel

4.继续安装

# 进入ncdu-1.15.1目录中
# 执行编译指令
[root@localhost ncdu-1.15.1]# make

# 执行安装指令
[root@localhost ncdu-1.15.1]# sudo make install

 5.验证与使用

执行指令 ncdu /  可见以下内容,至此,安装成功

ncdu 1.15.1 ~ Use the arrow keys to navigate, press ? for help                  
--- / --------------------------------------------------------------------------
    3.6 GiB [##########] /media                                                 
    2.8 GiB [#######   ] /usr
  362.0 MiB [          ] /tmp
  284.8 MiB [          ] /var
   93.1 MiB [          ] /boot
   32.7 MiB [          ] /etc
    8.8 MiB [          ] /run
    8.4 MiB [          ] /root
  140.0 KiB [          ] /dev
   12.0 KiB [          ] /home
.   0.0   B [          ] /proc
    0.0   B [          ] /sys
    0.0   B [          ] /opt
@   0.0   B [          ]  lib64
@   0.0   B [          ]  sbin
@   0.0   B [          ]  lib
@   0.0   B [          ]  bin
e   0.0   B [          ] /srv
e   0.0   B [          ] /mnt


 Total disk usage:   7.1 GiB  Apparent size: 128.0 TiB  Items: 283620           

参考链接: https://unix.stackexchange.com/questions/3979/how-can-i-install-ncdu-on-red-hat/360442#360442

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值