How to detect and clean hard drive memory with QDirStat in Linux

QDirStat was developed from an old, tested KDirStat tool, with the purpose of presenting statistics on how computer memory is used in a human-friendly way.

QDirStat was developed from an old, tested KDirStat tool, by the same author, Stefan Hundhammer. Both programs serve the same purpose: Presenting statistics about how computer memory is used in a human-friendly way.

The program does not display the information obtained as an integer and a percentage, but according to the hierarchical tree structure and graphical map. This makes it easy to find and delete unnecessary files to reclaim the space they occupy.

The app not only displays statistics about the files, it also allows you to take actions on them. You can delete them through the application, clean up what's left of the GIT sync process or run and delete junk files, etc.

Using QDirStat in Linux

  1. Install QDirStat
  2. Select the path for analysis
  3. Tree view and visual map
  4. Put the file in the trash and delete the file
  5. Action compression and cleanup
  6. Customize the cleanup

Install QDirStat

You might be able to find QDirStat in the software center of the distribution. Search by name from the main graphical software management tool of the distribution and install through it.

How to detect and clean hard drive memory with QDirStat in Linux Picture 1How to detect and clean hard drive memory with QDirStat in Linux Picture 1

If you prefer the terminal, on Debian and Ubuntu compatible distributions, you can install QDirStat with:

 sudo apt install qdirstat 

QDirStat does not require KDE libraries (or Gnome or some other desktop environments), in addition to QT and Perl, so this will be a relatively quick and easy installation.

Select the path for analysis

When run, QDirStat takes immediate action by asking which source path to investigate. You can choose any path accessible via the local or remote file manager. If it is mounted and accessible, QDirStat can use it.

After selecting a path, click Open to select it and move to the main QDirStat window.

Tree view and visual map

After analyzing the selected path content for a short time, QDirStat will present its findings in two different ways in the main window.

The first is a tree view, unlike in other file managers. The difference is that DirStat sorts it by default based on the size of each item, with the items having the largest capacity on top.

At a glance, you can check how much memory a directory occupies, its actual size in bytes (KB / MB / TB), etc.

You can expand any folder to see content, by clicking on the small arrow on the left.

How to detect and clean hard drive memory with QDirStat in Linux Picture 2How to detect and clean hard drive memory with QDirStat in Linux Picture 2

At the bottom of the window, you can see a second graphical view of everything in the path.

Each rectangle represents a different file and the larger the rectangle, the more the file takes up storage space.

Put the file in the trash and delete the file

After locating the file or folder you want to remove, right-click Move to Trash or select the file and then press Delete on your keyboard.

The file / folder will remain in the operating system's trash folder until it is deleted or other files require the space it takes up.

For permanent deletion, select the 'Delete (no way to undelete!)' Option or press Ctrl + Delete on your keyboard with a file or folder selected.

As stated, it is useless to double check what you delete with this option because there is no undo feature.

Action compression and cleanup

When choosing folders instead of files, QDirStat offers more options to recover lost storage.

Right-click on a folder and QDirStat will allow you to compress its contents to reduce the amount of space they take up.

You can also delete any rest of GIT creation and synchronization by selecting those options ( 'make clean' and 'git clean' ) from the right-clicking menu.

Avoid 'Clear Directory Contents' , as it will erase everything in a directory (unless that's what you asked for).

Finally, 'Delete Junk Files' removes the files that it locates in the selected path and realizes it as garbage. You can specify what is needed in the Settings section of QDirStat.

Customize the cleanup

Select Settings> Configure QDirStat to correctly configure QDirStat. The program groups its custom options in 4 tabs.

How to detect and clean hard drive memory with QDirStat in Linux Picture 3How to detect and clean hard drive memory with QDirStat in Linux Picture 3

  1. Cleanup Actions allows you to check the current program functions that can run on selected files and folders. Here, you will also find options for 'Open File Manager Here' and 'Open Terminal Here' . You can rearrange the actions and add new ones if you want.
  2. MIME Categories is where you can identify different file groups based on patterns defined in their file names. For example, you can include temporary files in the 'Junk' MIME Category by adding '* .tmp' in the 'Patterns (Case Insensitive)' field.
  3. Exclude Rules creates a list of files and folders that the program cannot access. Perhaps it is best to add any important folders and files that you do not want to be affected by the operation of the program.
  4. General has a number of basic options regarding the operation and aesthetics of the application - ignore it.

QDirStat is useful for finding large but useless files, taking up all of your storage space, but as you can see, it is even more useful if you customize the existing cleanup actions or settings. its own option.

This way, you will know what these actions do and how they affect files, creating cleanup scripts that let the excess data sink into oblivion with just two clicks.

5 ★ | 1 Vote