hledger/hledger/doc/examples.m4.md
2016-05-06 18:27:35 -07:00

84 lines
2.1 KiB
Markdown

# EXAMPLES
Two simple transactions in hledger journal format:
```journal
2015/9/30 gift received
assets:cash $20
income:gifts
2015/10/16 farmers market
expenses:food $10
assets:cash
```
Some basic reports:
```shell
$ hledger print
2015/09/30 gift received
assets:cash $20
income:gifts $-20
2015/10/16 farmers market
expenses:food $10
assets:cash $-10
```
```shell
$ hledger accounts --tree
assets
cash
expenses
food
income
gifts
```
```shell
$ hledger balance
$10 assets:cash
$10 expenses:food
$-20 income:gifts
--------------------
0
```
```shell
$ hledger register cash
2015/09/30 gift received assets:cash $20 $20
2015/10/16 farmers market assets:cash $-10 $10
```
More commands:
```shell
$ hledger # show available commands
$ hledger add # add more transactions to the journal file
$ hledger balance # all accounts with aggregated balances
$ hledger balance --help # show detailed help for balance command
$ hledger balance --depth 1 # only top-level accounts
$ hledger register # show account postings, with running total
$ hledger reg income # show postings to/from income accounts
$ hledger reg 'assets:some bank:checking' # show postings to/from this checking account
$ hledger print desc:shop # show transactions with shop in the description
$ hledger activity -W # show transaction counts per week as a bar chart
```
With the journal
```journal
2016/02/16 Member Fee Payment John Doe
assets:bank account 2 EUR
income:member fees -2 EUR
; member: John Doe
```
the --pivot comand will output the following:
```shells
$ hledger bal --pivot member
2 EUR assets:bank account
-2 EUR member:John Doe
```