Home Linux Commandline Tools Hledger – A Plain Text Accounting Tool for Linux Terminal

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.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.