Linux Format

Disk space usage

-

No matter how large your hard disk, it will still gradually fill up. While larger disks make this less of a priority than it used to be, media files sizes are much larger now.

There’s also the matter of space wasted by files that are no longer needed, temporary and cache files dropped into your home directory by various programs, as well as things like package files left over from software updates. Whether you want to spend time reclaiming this wasted space depends on which you have more of, free space or free time, but the first step is to locate the space hogs.

There are several programs that will show you how much space each directory uses. KDE users can install Filelight while Gnome users probably already have DiskAnalyz­er on their system. For terminal use there’s the venerable du or the newer ncdu . With du you’ll need to pipe its output through sort to see the main users of space: $ du -du -sh * | sort -h Note: that this will not include hidden directorie­s as most shells do not match them with * . To see everything, use $ du -du -sh * .* | sort -h

One thing to be aware of with all of these programs is that they will also include files on different filesystem­s mounted under the paths you’re checking. Even if you use the -x switch with du , it will still descend into any filesystem­s whose mount point is covered by * . The simplest answer is to use ncdu (you’ll probably have to install this). Run it with ncdu -x to see a list of the directorie­s in the current directory, sorted by size but excluding any files on different filesystem­s. To view a different directory, give it on the command line. You can do more than view directory sizes in ncdu, highlight a directory and press Enter or Right to go into it and show a sorted list of its contents, press Left to go back up a level. There are other options: press ? to see a list. But being able to delete offending files as well as find them is one of the more useful additions. As always, be careful when deleting files.

 ??  ??

Newspapers in English

Newspapers from Australia