> and wouldn't have left an index behind for rapid reload, either.
ncdu supports writing results to a file and loading them as of version 1.9. It uses json which makes moving the data to other applications very easy. You can even pipe the json output to whatever you want.
ncdu -o file.json ncdu -f file.json ncdu -o- | gzip > file.json.gz ncdu -o- | anything-your-heart-desires
Try ncdu
!
sudo apt-get update && sudo apt-get install ncdu ncdu
A wonderful utility, once you've opened it in the terminal, simply use the arrow keys to browse. Your directories will be listed in order of hard disk space that they take up. More info here.
Windows only - Read below for CLI on *Nix
Lets face it - We're all guilty of having tons of DVD's and ISO's - But sometimes it can be dumps, log files or misc files that take up a lot of space.
Simply launch the app (Run as admin so it can scan your entire drive), wait whilst it goes through your drive and will display a nice graph of where your space is going.
Screenshot - Credit to TreeSize
Linux - I recently discovered this and fell in love with it immediately.
I kid you not, it scanned a 4TB SSD/HDD (RAID) in < 5 seconds on first install; after running it multiple times, it got down to 2 seconds...Yes, two seconds.
>There is also a CLI program that does the same, but I can't recall what it is called.
You might be thinking of ncdu? Definitely one of my must-installs on new boxes.
> I think it's all just cache.
Don't think, know ;)
Check out ncdu http://dev.yorhel.nl/ncdu which is great for drilling down in to disk usage.
Most cache should be in ~/.cache and most of what's in there should get put somewhere else if you set $XDG_CACHE_HOME.
Anything mounted as tmpfs is in ram and gets lost on reboot. E.g. /dev/shm and depending on which distro you're using, /tmp.
> Using htop instead of top >
I personally find atop
and nmon
much useful than htop.
> Using du -sh * | sort -sh, to sort files/directories by size >
Ooookay well this won't be an exhaustive list or anything, just what I can think of off the top of my head. Here we go:
grep -Rni "search phrase" $PWD
** I use this very often. It's a great way of searching all files under your current working directory for any which contain the specified search term
less -n
** I use this with large log files. The -n
forces less to suppress line numbers. This means I can press Shift+G and instantly jump to the end of the log file. If I didn't pass -n
, it could take a very long time
ncdu
** Not a bash command as such, this needs to be installed via your distro's repo. It's a very small (less than 100KB) ncurses disk usage viewer. I find it very very useful for working out where the disk space is being used on servers. Website here.
find
** Too much to say about find
here, but I use it an awful lot. It's definitely worth looking at.
for
loops** I use for
loops fairly often. They're not too complex: for example, for server in blah1 blah2 blah3 ; do ssh $server [command here] ; done
, or while sleep 1 ; do uptime ; done
xargs
** xargs
is great! Again, too much to write about the command here, but basically you pipe stuff to xargs
and it will read it and treat it as input for something else. For example... hmm... ps aux | grep blah | awk '{ print $2 }' | xargs [some command that handles PIDs here, like kill]
Ctrl+R
** Search interactively through your bash history
It's entirely possible you might know a lot - or all - of these already, and that's cool! Honestly there's not much that I do that's really all that complex. :) it's quite hard to think of anything really obscure... so this may be a little disappointing.
But other things will grow larger, like web browser caches, etc.
I don't know how to move Steam, but you might poke around to see what else is taking up space too, just in case Steam isn't the problem.
I just use du -skh *
from the command line, but it looks like there are a few friendlier tools available too:
There's a good list on the ncdu
page that might have better options. Some of these might be available from the OS software installer.
I love this kind of tools that help you quickly find big files:
So if you have a folder with your own data, you can quickly analyze it to find big stuff and delete some of it. Obviously, I don't recommend removing any system file/directory just because it's big, that might give bad results ;).
If this is what you meant, then for me it's a case of liking the visual style it offers, and being able to quickly drill down into subfolders.
Command line tools are great, but I don't always like to use them, and in this case it doesn't give a graph/pie breakdown of usage.
du
can take a very long time, yes. Just let it run.
Alternatively, take a look at ncdu. It also takes a long time to run, but it gives you a much better way to visualize what takes up space.
If you like the "dark" side, explore the black screen, there's so much you can do in a terminal: http://linuxcommand.org/tlcl.php
A little program I love that might not come preinstalled in Mint (not sure): ncdu