Sep 08, 2016 Tag: Linux
Today I was to install something for a customer in his shared hosting account. What was eating up most of the available disk space? ncdu is a phantastic tool on the commandline to answer that. Only: It wasn’t available. So I tried to install it as a regular user - and succeeded! Thank you jweiland for fullfilling the requirements for that. And this is what I did.
Updated on Sep 09, 2016
This is ncdu. You can easily and interactively investigate which files are consuming what disk space on the commandline:
Is it already available?
$ ncdu
bash: ncdu: command not found
No, it isn’t. So let’s install it as a regular user.
Go to your home directory:
$ cd
Visit ncdu’s homepage and find out about the latest source package. Currently it is 1.12. Download the source package:
$ wget https://dev.yorhel.nl/download/ncdu-1.12.tar.gz
Unpack:
$ tar xzf ncdu-1.12.tar.gz
Enter the source folder:
$ cd ncdu-1.12/
The next step is to run ‘configure’ to create a ‘Makefile’. Since we are a regular user we use the prefix parameter to tell configure to use our home folder as base for the usual subfolders like ‘bin/’ and ‘lib/’:
$ ./configure --prefix=$HOME
Now build the binary:
$ make
And install:
$ make install
Verify: The executable should now be in $HOME/bin:
$ ls -la $HOME/bin
Repeat this step whenever you start a new shell.
And start using ncdu:
$ ncdu
bash: ncdu: command not found
Oops, what’s that? Look at your path:
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
Aha, our private bin/ folder is not in the path. So let’s change this:
$ PATH=$PATH:$HOME/bin
And again: Start using ‘ncdu’:
$ ncdu
Yeah, victory! See the screenshot above.
If you want to have your $HOME/bin path included always automatically - try using ‘.bashrc’ file. Works like a charm in my case at jweiland. Thank you Jochen for the tip:
# go home
cd
# new line
echo >> .bashrc
# the important line
echo export PATH=$PATH:$HOME/bin >> .bashrc
Published under the CC-BY License
Enter search terms.
Upgrade to Python 2.7.11 on Ubuntu 14.04 LTS
Take Huge And Giant Screenshots