Question: My hard drive became full. I am looking for ways to locate the things that use most of my disk space. I played with cron once so it may have consumed a great deal of space, but really I have no clue.

I have backed up my things to CDs, but the system is still getting too slow. Perhaps I should reinstall everything, but whilst fixing the problem it doesn’t address the cause.

Testing KamilMaciorowski’s answer for ncdu

I run ncdu as root and get the following where I missed out the backup file in my system by other methods

— /home/masi —————————————————————————————————————————————————————————————————- ?45.5GiB [##########] ?backup_home_1.9.2016.tar.gz ?34.9GiB [####### ?] /Documents ????????????1.4GiB [ ?] /Videos ?1.4GiB [ ?] /.cache ?1.2GiB [ ?] /Downloads ?1.0GiB [ ?] /.config ?607.8MiB [ ?] /Pictures ?487.0MiB [ ?] /.matlab ?447.2MiB [ ?] /Images ?406.1MiB [ ?] /Desktop ?97.1MiB [ ?] /.kingsoft ?58.4MiB [ ?] /.local ?20.6MiB [ ?] /.Mathematica ?13.3MiB [ ?] /.mozilla ?…

Answer: Linux tool ncdu is very convenient in my opinion. It’s like interactive du.

Some features

  • Text interface (ncurses); works via SSH, no Xserver needed.
  • Still you can move within directory tree to find large dirs/files quickly.
  • You can delete dir/file from within the program.

Screenshot

Well, kind of. There’s no point in pasting picture, text will be enough:

ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help ??— / ————————————————————————– ?6,7GiB [##########] /usr ?3,4GiB [##### ?] /var ?553,1MiB [ ?] /lib ?529,1MiB [ ?] /opt ?35,1MiB [ ?] /etc ?32,5MiB [ ?] /home_old ????16,4MiB [ ?] /sbin ?9,9MiB [ ?] /bin ?8,2MiB ncdu help 1:Keys 2:Format 3:About ?3,8MiB ???? ?1,3MiB ?up, k ?Move cursor up ?? ?500,0KiB ?down, j ?Move cursor down ?? ?124,0KiB right/enter ?Open selected directory ?? ?12,0KiB ?left, <, h ?Open parent directory ?? ?8,0KiB ?n ?Sort by name (ascending/descending) ? @ ?4,0KiB ?s ?Sort by size (ascending/descending) ? @ ?4,0KiB ?C ?Sort by items (ascending/descending) ? @ ?4,0KiB ?d ?Delete selected file or directory ? ?0,0 ?B ?t ?Toggle dirs before files when sorting ? > ?0,0 ?B ?g ?Show percentage and/or graph ? e ?0,0 ?B ??– more — ?? > ?0,0 ?B ???Press q to continue ? > ?0,0 ?B > ?0,0 ?B [ ?] /home> ?0,0 ?B [ ?] /deve ?0,0 ?B [ ?] /cpusetse ?0,0 ?B [ ?] /cdrom> ?0,0 ?B [ ?] /boot Total disk usage: ?11,3GiB ?Apparent size: ?11,1GiB ?Items: 289029 ?

Usage:

ncdu -x /foo/bar/mountpoint

Use sudo (and caution!) when necessary. The -x option is important, it makes ncdu stay within single filesystem (du has the same option). In the example (above) my /home is on a different partition than / where ncdu started, therefore it does not count �C thanks to -x switch exactly.