Skip to content

Dataclean: a GTK 4 disk space analyzer and duplicate finder for Linux

Open-source software · 3 min read · updated

Dataclean is a small GTK 4 app, written in C, that shows where your disk space goes and helps you free it safely. It finds byte-for-byte duplicate files and forgotten leftovers, and it never deletes anything: files go to the Trash after a confirmation, with checks right before each move and an undo.

Platform
Linux (GTK 4)
Language
C
Licence
MIT
Requires
  • gcc and make tools (build-essential)
  • GTK 4 runtime; run.sh fetches the dev headers locally if missing
Run
./run.sh from the repository folder
Dataclean Duplicates view: groups of identical files such as holiday.mp4 and panorama.jpg, each listing its copies with one marked as staying.
The Duplicates view. The screenshots in the repository show a throwaway demo folder, not real data.

How do I run Dataclean?

./run.sh                # build if needed, then open the app
./run.sh --scan PATH    # summary in the terminal
./run.sh --selftest     # check the duplicate and trash engine on a throwaway folder

run.sh compiles against the system GTK 4 headers (libgtk-4-dev). If they are not installed, it downloads the -dev packages with apt-get download into .deps/ without root and links against the GTK 4 runtime already on the system.

How does Dataclean find duplicates?

A duplicate is a file that is byte-for-byte identical to another. To avoid reading every file in full, candidates are narrowed in stages, cheapest test first:

StageWhat is compared
1File size.
2SHA-256 of the first and last 16 KiB.
3SHA-256 of the whole file.
Before a moveA byte-for-byte comparison with the copy that stays.

Hard links of one file count once, and files under 1 KiB are ignored.

What else does it look for?

Besides duplicates, Dataclean lists leftovers: temp files untouched for 3 or more days, unfinished downloads idle for 2 or more days, editor swap and lock files, core dumps, .DS_Store and Thumbs.db clutter, thumbnails not viewed for 30 or more days, and cache files untouched for 90 or more days. Files that a running program has open are never listed.

The where space goes views total usage by disk, file type, place (your files, app data, system, temp), folder (drill down in Explore) and by when files were last changed. Each scan is added to a disk-use history.

How does it keep deletion safe?

  • Nothing is deleted. Files go to the Trash (freedesktop specification, through GIO). If a disk has no Trash, the file stays where it is.
  • Duplicate cleaning always leaves one normal copy. Copies in temp or cache folders, or inside app and system internals (.git, node_modules, site-packages, dot-folders in home, /usr), never count as the copy that stays, and are locked unless you tick include app & system folders.
  • Right before each move, the file must still match the scan (same inode, size and modification time) and must not be open. If any check fails, the file is skipped and the reason is shown.
  • Moving duplicates asks for confirmation. Moving files that have no other copy shows a red warning that lists them, and a box must be ticked before the button works.
  • Undo puts the last batch back where it was, as long as nothing new has taken its place.
  • Every move and restore is logged in ~/.local/share/dataclean/actions.log.

Quick answers

Does Dataclean permanently delete files?
No. Files are moved to the Trash after a confirmation. If a disk has no Trash, the file stays where it is. Undo restores the last batch as long as nothing new has taken its place.
Does Dataclean need root to run?
Not to run. If the GTK 4 development headers are missing, run.sh downloads the -dev packages with apt-get download into .deps/ without root and links against the GTK 4 runtime on the system.
Which files count as duplicates?
Files that are byte-for-byte identical. Hard links of one file count once, and files under 1 KiB are ignored.
Can it remove the only copy of a file?
Duplicate cleaning always leaves one normal copy. Moving files that have no other copy shows a red warning listing them, and you must tick a box before the button works.

More on Downloads