I have a headless server running Centos 5.9. I can only SSH into it, is it possible to use KdirStat or a similar tool to get a graphical view of disk usage?
kdirstat-cache-writer Perl script on your server, copy the file to your desktop machine and view it there with QDirStat / KDirStat.
Update 2017-02-23: Detailed instructions available at
-- HuHa (QDirStat / KDirStat author)
You can use sshfs to mount
/ on your desktop to
/mnt/server/ on your pc. Then you start Kdirstat on this directory.
If you're running an X server on the system you're running
ssh on you should need to do nothing more than this:
$ ssh -X remoteserver KdirStat
Here for example I'm
ssh'ing into a CentOS 5.9 system running Babaob, another disk utilization app that comes with GNOME.
Incidentally there are a lot of applications for analyzing disk usage. I wrote them up here on my blog in a post titled: Command Line Tools for Analyzing Disk Usage on Fedora/CentOS/RHEL.
You can log into the server and use
du, redirecting that output to a file (
-a = include files, not just directories;
-x = one filesystem only):
$ du -ax / > ~/root-du
then you can scp that file back, and browse it graphically with
$ scp server:root-du ~/root-du $ xdiskusage ~/root-du
Of course, you can run
du remotely over ssh, and pipe it to
xdiskusage as well:
$ ssh server 'du -ax /' | xdiskusage
but I prefer to use files, so I can re-open it, compare before & after, etc.
Having X installed/running on a server is considered to be a really bad practice, mostly because of security and stability issues.
Simply use KDE's KIOs which make it really easy to use a lot of different protocols in KDE applications.
Use a URL like
sftp://user@host/some/directory to access the remote filesystem via SSH/SFTP: