The Linux command line can be used for many things, like making spreadsheets, playing music, or accessing Facebook or Twitter. And to pursue our dream of ultimate graphic-less knowledge, I propose you today with a tool to manage your personal expenses from the command line. The name is GNU Pem, for Personal Expense Manager.
Installation of GNU Pem
Debian or Ubuntu
I could not find a PPA for recent versions of Ubuntu, so the simplest way is still to download the package from the official source, extract it, and then run the traditional:
$ sudo make install
For Arch Linux users, you can check out the AUR.
Fedora or CentOS/RHEL
For CentOS/RHEL, you need to enable EPEL repository first.
Usage of GNU Pem
Pem uses your system clock to record your transactions. So before using it, make sure that the time on your computer is correct.
Pem is very easy to understand. The basic usage to record an expense is:
where [tag] is anything that will remind you of your expense.
So for example:
will remind me that I spent $10 in candy today. If I want to use spaces in my tag, I like to use quotation marks:
To record an income, use the flag -e:
Finally, to see your expenses for the last n days, use the command:
Notice that if you leave n blank, it will show you all your expenses for the day nicely formatted.
It is possible to have a monthly report with a similar structure:
But a really helpful feature is the ability to set categories. Using the flag -c you can specify a category for your expense.
An example would be:
for spending $2 buying a Pac-Man game.
And you can see all the categories with:
Behind the scenes, Pem will create by default a .pem folder in your home directory in which it will store your transaction using the directory structure:
.pem/[last two digit of year]/[Month]
A transaction will be recorded in the month file using the format:
If you wish to write your expenses to a specific file, you can use the -f flag:
The details are not that interesting, unless you want to export the data later. The programmers suggest using a spreadsheet software to do so.
To conclude, I really enjoy using Pem. It is a nice little piece of sotfware that does one job and does it well. It is possible to imagine combining it with some sort of script to automate the whole process. I could probably use it to record all the money I spent buying Steam games on sale. I encourage you to visit the official page, and read the manual entry to learn more about it.
What do you think of Pem? Would you consider using it or is it too nerdy? Let us know in the comments.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!