Next Previous Table of Contents
Like most KDE applications, KDirStat provides a menubar and a toolbar. Both can be torn off, hidden or moved to other edges of the main window. Use the small handle to the left of the bars to do that. Right-click on them to pop up context menus for those operations.
Since most menu options are pretty straightforward, they will be explained in detail in some later section.
The tree display is the centerpiece of KDirStat. It uses most of the program's screen space.
If all you see is an empty window, you might have to open a directory for investigation. Use 'Open' or 'Add' from the 'File' menu and select a directory in the directory selection box that is popped up.
The tree displayed represents a directory hierarchy. Subdirectories can be expanded or collapsed with the '+' or '-' signs, respectively.
Directories have a 'folder' icon, files a 'stack of paper' icon, symbolic links a small curved arrow.
The tree can be sorted by any column. Just click on a column header to sort by that column.
Symbolic links are not followed.
The bar graph in the 'Subtree Percentage' column display the same as the 'Percentage' column, just graphically: The percentage of disk space used by that object within the same directory level. That is, all objects in any directory level always add up to 100%. Comparing those bars makes sense just within that single level, not outside. But within that level you can at a single glance which object (subdirectory and/or file(s)) take up most space. Even more so since entries on any level are sorted by this percentage by default.
In order to make that comparison easier, each level is displayed in some other color. Those colors can be customized in the 'Settings' dialog (available via the 'File' menu).
The 'Subtree Total' column displays the total size of a directory subtree in kB (Kilobytes, 1024 Bytes), MB (Megabytes, 1024*1024 Bytes) or GB (Gigabytes, 1024*1024*1024 Bytes). You can display the exact number in bytes by right-clicking on the number.
The 'Own Size' column displays the own size of an object. For files, this is the file size (obviously). For directories, this is the size of the directory itself without any files or subdirectories.
'Items' counts the number of any items in a subtree - files, directories and symbolic links. Special files (devices, FIFOs, ...) are treated as plain files.
'Files' counts the number of plain files (see above). Directories and symbolic links are excluded here.
'Subdirs' counts the number of subdirectories on any level from here on.
Most directories have a special <Files> entry. This is an artificial entry that doesn't really correspond to anything on the disk. Rather, it is a pseudo entry that just serves as a container to hold all the individual files of a directory.
The basic idea behind this is that most directories become too cluttered up with objects if files and directories are mixed together in one single display. This is why most file managers (e.g. KFM) use a tree window for the directories and a directory contents window for the files within one directory. But this limits the display to one directory's contents at a time. Not really very useful if you want to compare sizes of different objects, maybe even from different directories.
Remember, one large file (e.g. core dump files) might easily eat up more disk space than all subdirectories of that directory! So it makes perfect sense to have all that information in one display. Plus, the objects to be compared (files and directories) have at least similar properties - they all have sizes that can be compared.
Thus, the compromise here was to introduce a new, albeit artificial, container for a subdirectory's files - the <Files> pseudo entry.
If one file of a directory is very large, the sum of all files in that directory (excluding the subdirectories!) will be large, too. This is what the <Files> pseudo entry displays. And this is what you can easily compare to the sums of the other subdirectories of that level.
When a directory is opened, it will be scanned. The tree display will show no bar graphs yet (since the respective sums are not finished yet, so it doesn't make sense to calculate percentages yet). Rather, there will be gear wheels in subdirectories that are still in the process of being scanned.
You can work with the tree in this stage, but always be aware that periodically the tree will be re-sorted by subtree size, so the order of objects may change while you are trying to click on them.
It is not recommended to perform dangerous tasks while the tree is still scanned - the danger of accidentially deleting something else than desired is just too high (but you can, if you really want). But expanding and collapsing subtrees is perfectly okay and without any danger.
Once things have settled down (i.e. nothing moves any more, and the status bar at the bottom of the window says 'Ready.'), you can move about the tree at will.
As mentioned before, the tree is sorted by subtree percentage by default. This means the objects that use up most disk space on any level are sorted on top.
Those are the items you might want to inspect first. Open up (expand) the top-most item the top level. You can click on the '+' sign or just double-click anywhere in the line (even on the percentage bar). Or you can use the keyboard (the cursor keys; you may have to hit the 'tab' key first in order to get the keyboard focus inside the tree. I think this is a Qt bug).
You might want to repeat that process in any level until you find something that doesn't belong there or something you don't want in the first place (e.g. a large core dump file) or something that might as well be archived or compressed. See the 'Cleaning up' section below to learn what to do about that.
When you are finished with that level, move up again. You can, of course, just scroll down. But you will soon find it is much easier to close the level you are done with. There is a shortcut for closing a level and moving up to the parent level: Select 'Move up' from the 'View' menu or hit 'Ctrl' + 'Cursor up'.
Next Previous Table of Contents