Hledger – A Plain Text Accounting Tool for Linux Terminal

Accounting is a business term that entails the measurement, processing, and communication of monetary information (financial and non-financial). It is never an easy task to grow your accounting skills when all the software you need either has a fixed monetary value or a non-negotiable subscription plan. However, the Linux operating system ecosystem is opening its doors to accountants and users that like to get accountability for personal/business monetary expenditures.

This article will walk us through the installation and basic usage of the hledger command-line accounting tool in a Linux operating system environment.

What is Hledger Accounting Tool

The hledger accounting tool is free to use on any Linux distribution. It is also attributed as a high-quality plain text app which confirms its use of version-controllable and human-readable plain text files that are efficiently processed on Unix systems like Linux.

With Hledger, you can track assets like inventory, time, cryptocurrencies, investments, and money. Also, your tracked assets will be linked to documented future-proof data format and complete history of associated changes.

Who Should Use Hledger?

Non-programmers will greatly acknowledge its general robustness, flexible user interface, built-in financial statements, easy CSV import system, and multi-period reports.

As for programmers, a round of applause goes to Hledger’s Haskell implementation (clean and statistically typed), reliability (1100+ tests), speed, powerful scriptability/embeddability, and accuracy (supports 255 decimal places).

Hledger Features

We can summarize the features associated with the hledger accounting tool in the following bullet points:

  • Easy to install on Unix systems like Linux.
  • GPLv3+ free software license.
  • Scriptable through API, CLI, or HTTP.
  • Supports preferred number formats, currencies, and account names.
  • On machines like MacBook air m1 or ones with similar specs, 25k transactions can be analyzed in a single second hence confirming the processing speed of Hledger.
  • Can import and export CSV formatted files and output HTML/text/SQL/JSON.
  • It is accompanied by complete built-in documentation through beginner tutorials, videos, and other multiple formats.
  • Clean Haskell codebase.
  • 255 decimal places supported.
  • multi-currency accounting engine (robust and well-specified).
  • Multiple Uis like editors/IDEs, web, mobile, terminal, and command-line.

Installing Hledger Command Line Accounting Tool in Linux

The easiest and most flexible approach to installing the Hledger accounting tool on our Linux system is through the Homebrew package manager.

Fortunate enough, we already have the article on how to install and use Homebrew on your Linux operating system.

Once you have homebrew installed on your system, you can confirm the readiness of your system:

$ brew doctor

Your system is ready to brew.

Now search and install the hledger package with its dependencies.

$ brew search hledger
$ brew install hledger 
Install Hledger in Linux
Install Hledger in Linux

Confirm that hledger was successfully installed on your Linux system by running the following command, which will be presented with a manual on how to use the hledger accounting tool.

$ hledger
Confirm Hledger in Linux
Confirm Hledger in Linux

Let us try to manually record a transaction from the Linux terminal.

$ cat >main.journal
Record Transaction in Linux
Record Transaction in Linux

Save with Ctrl+d.

Let us export the created file:

$ export LEDGER_FILE=main.journal  

For future sessions to reference this file, run:

$ echo 'export LEDGER_FILE=main.journal' >>~/.bashrc 

To add a transaction, you will simply need to run the command:

$ hledger add

If the transaction does not balance (like in the above case), Hledger is smart enough to detect it.

Add Transaction in Linux
Add Transaction in Linux

More usage of hledger can be found on its manual page:

$ man hledger

With the hledger accounting tool, hope your accounting routines will become more exciting and less strenuous.

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.