#+TITLE: disk-usage.el

Disk Usage is a file system analyzer: it offers a tabulated view of file
listings sorted by size.  Directory sizes are computed recursively.  The results
are cached for speed.

This package answers the shortcomings of ~dired-du~ (notably that it's not able
to sort by size, see [[https://github.com/calancha/dired-du/issues/2]]).  It also
aims at replacing other, more limited disk analyzers such as =ncdu=.

* Installation

Get the package, either from [[https://guix.info][Guix]] or ELPA:

: M-x package-install RET disk-usage RET

Or clone / download this repository and modify your ~load-path~.

: (add-to-list 'load-path (expand-file-name "/path/to/this-package/" user-emacs-directory))

Load the package with

: (require 'disk-usage)

Warning: BSD and macOS users need `gdu`, the "GNU du" from the "GNU coreutils".

* Features

Run ~disk-usage~ or ~disk-usage-here~ to display a listing.  See ~describe-mode~
to display additional bindings, such as ~disk-usage-dired-at-point~ to open a
~dired~ buffer for the current directory.

Instead of displaying only the current folder, ~disk-usage~ can also display
files in all subfolders recursively with ~disk-usage-toggle-recursive~.

Marked files can be trashed with `disk-usage-delete-marked-files'.  When called
with a prefix argument, files are deleted permanently.

Run ~disk-usage-by-types~ to display statistics of disk usage by file
extensions.

With a prefix argument, cache is updated when reverting the buffer.

With ~disk-usage-add-filters~ you can filter out files with arbitrary
predicates, e.g. files bigger than some size or older than a certain number of
days.

~disk-usage~ also works with TRAMP, i.e. in folders with restricted-acess like
=/sudo::/root= or on remote machines.

You can customize options in the =disk-usage= group.

* Screenshots

- Hierarchical disk usage display:
  #+ATTR_HTML: :width 800px
  [[./disk-usage.png]]
- Disk usage by file extensions:
  #+ATTR_HTML: :width 800px
  [[./disk-usage-by-types.png]]
