Freeing up space the OS isn't using right now

(Andy Wootton) #1

I’ve mentioned before that I got into Linux to learn the *x command line because I saw my future being in sysadmin but my career took a different direction, so I found the GUI desktop did everything I needed and I didn’t bother. This occasionally comes back to bite me.

My ‘travel computer’ (portable typewriter) is an ASUS Eee PC netbook with 8GB + 32GB SSDs and 1GB of memory. I like a challenge. Increasing OS memory requirements have forced me off Ubuntu onto Lubuntu but there wasn’t space to upgrade to the latest version, in 8GB. I’ve deleted everything I can do without but still needed to find another 150MB. I think we all find ourselves in a similar position occasionally, so I thought it might be worth recording where there is ‘crap we can scrap’ on a variety of operating systems.

I found out where the logs go and discovered that on Lubuntu
/var/log/journal/ uses a lot of space (relatively.) It seems to be automatically cleared down on rotation and I read that more could be deleted without ill effect. It was 13th October so I decided to delete anything older than 13 days and found a bash magic spell which has now allowed Lubuntu’s fetch to happen:
$ sudo find /var/log/journal/2a33a91d6e2c4ad0a4a336969bcfd943 -mtime +13 -exec rm {} ;

Please share other space-saving tips here.

(Marc Cooper) #2

ncdu is a handy tool to uncover where space is being used.

Install, then run: sudo ncdu /

(Jon) #3

Docker is notorious for consuming disk space. These two are very powerful, so be careful what you’re deleting:

docker system prune
docker container prune

On a well-used dev machine, I’ve saved 10G+ with one or the other of those.