Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (73 sloc) 3.08 KB

## Time-stamp: <2017-03-26 22:50:17 vk> ## -*- mode: org; coding: utf-8 -*- ## This file is best viewed with GNU Emacs Org-mode:


This Python 3 script parses parses a list of Org-mode files and generates output similar to du (disk usage) but with lines of Org-mode instead of kilobytes.

The purpose of this script is to use its output as the input for xdu in order to get a graphical visualization: | xdu

The script accepts an arbitrary number of files (see your shell for possible length limitations).


GNU/Emacs Org-mode does a great job for outlining (collapsing and expanding). However, when you want to get a brief overview on the amount of content of each heading (e.g., to locate performance optimization possibilities), you need a different tool: org-du


Get it via GitHub or install it via pip: pip install org-du


./ --help
usage: [-h] [-v | --quiet | --version] file [file ...]

org-du parses a list of Org-mode files and generates
output similar to "du" (disk usage) but with lines
of Org-mode instead of kilobytes.

positional arguments:
  file           a list of file names

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose
  --version      show program's version number and exit

Verbose description:

:copyright: (c) by Karl Voit <>
:license: GPL v3 or any later version
:bugreports: via github or <>
:version: 2017-03-26


If you apply org-du to this file, you will see following visualization:


You can navigate through sub-headings using your mouse. Navigate back by clicking on the leftmost item of the visual tree. Exit with q.

Another cool usage scenario is when you invoke org-du on one host (Windows) and visualizing is done on a different host. This can easily be accomplished by re-directing the output of the script:

Host A (Windows): *.org > org-du-output.txt

Then copying the file org-du-output.txt from host A to host B.

Host B (GNU/Linux):

xdu < org-du-output.txt


  • <2017-03-26 Sun>: first version on GitHub and pip

How to Thank Me

I’m glad you like my tools. If you want to support me:

  • Send old-fashioned postcard per snailmail - I love personal feedback!
  • Send feature wishes or improvements as an issue on GitHub
  • Create issues on GitHub for bugs
  • Contribute merge requests for bug fixes
  • Check out my other cool projects on GitHub

Local Variables