-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman.ledger.txt
1171 lines (872 loc) · 57.4 KB
/
man.ledger.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
LEDGER(1) General Commands Manual LEDGER(1)
NNAAMMEE
lleeddggeerr - Command-line, double-entry account reporting tool
SSYYNNOOPPSSIISS
lleeddggeerr [_o_p_t_i_o_n_s] [_c_o_m_m_a_n_d] [_a_r_g_u_m_e_n_t_s]
DDEESSCCRRIIPPTTIIOONN
lleeddggeerr is a command-line accounting tool based on the power and
completeness of double-entry accounting. It is only a reporting tool,
which means it never modifies your data files, but it does offer a large
selection of reports, and different ways to customize them to your needs.
CCOOMMMMAANNDDSS
lleeddggeerr accepts several top-level commands, each of which generates a
different kind of basic report. Most of them accept a _r_e_p_o_r_t_-_q_u_e_r_y
argument, in order to determine what should be reported. To understand
the syntax of a _r_e_p_o_r_t_-_q_u_e_r_y, see the section on _Q_U_E_R_I_E_S. In its most
basic form, simply specifying one or more strings produces a report for
all accounts containing those strings.
If no command is given, lleeddggeerr enters a REPL, or command loop, allowing
several commands to be executed on the same dataset without reparsing.
The following is a complete list of accepted reporting commands:
aaccccoouunnttss [_r_e_p_o_r_t_-_q_u_e_r_y]
List all accounts for postings that match the _r_e_p_o_r_t_-_q_u_e_r_y.
bbaallaannccee [_r_e_p_o_r_t_-_q_u_e_r_y]
Print a balance report showing totals for postings that match
_r_e_p_o_r_t_-_q_u_e_r_y, and aggregate totals for parents of those
accounts. Options most commonly used with this command are:
----bbaassiiss (--BB) Report in terms of cost basis, not amount or
value. This is the only form of report which
is guaranteed to always balance to zero, when
no _r_e_p_o_r_t_-_q_u_e_r_y is specified. Only show totals
for the top-most accounts.
----eemmppttyy (--EE) Show accounts whose total is zero.
----ffllaatt Rather than display a hierarchical tree,
flatten the report to show subtotals for only
accounts matching _r_e_p_o_r_t_-_q_u_e_r_y.
----nnoo--ttoottaall Suppress the summary total shown at the bottom
of the report.
The synonyms bbaall and bb are also accepted.
bbuuddggeett [_r_e_p_o_r_t_-_q_u_e_r_y]
A special balance report which includes three extra columns: the
amount budgeted during the reporting period, how spending
differed from the budget, and the percentage of budget spent
(exceeds 100% if you go over budget). Note that budgeting
requires one or more "periodic transactions" to be defined in
your data file(s). See the manual for more information.
cclleeaarreedd [_r_e_p_o_r_t_-_q_u_e_r_y]
A special balance report which adds two extra columns: the
cleared balance for each account, and the date of the most
recent cleared posting in that account. For this accounting to
be meaningful, the cleared flag must be set on at least one
posting. See the manual for more information.
ccoommmmooddiittiieess [_r_e_p_o_r_t_-_q_u_e_r_y]
List all commodities for postings matching the _r_e_p_o_r_t_-_q_u_e_r_y.
ccoonnvveerrtt Reads data from a CSV (comma-separated values) file and
generates lleeddggeerr transactions.
ccssvv [_r_e_p_o_r_t_-_q_u_e_r_y]
Report of postings matching the _r_e_p_o_r_t_-_q_u_e_r_y in CSV format
(comma-separated values). Useful for exporting data to a
spreadsheet for further analysis or charting.
eennttrryy [_e_n_t_r_y_-_t_e_m_p_l_a_t_e]
Generate and display a new, properly formatted lleeddggeerr
transaction by comparing the _e_n_t_r_y_-_t_e_m_p_l_a_t_e to the transactions
in your data file(s). For more information on draft templates
and using this command to quickly create new transactions, see
the section _E_N_T_R_I_E_S.
The synonym xxaacctt is also accepted.
eemmaaccss [_q_u_e_r_y]
Output posting and transaction data in a format readily consumed
by the Emacs editor, in a series of Lisp forms. This is used by
the Emacs ledger-mode to process reporting data from lleeddggeerr.
eeqquuiittyy [_r_e_p_o_r_t_-_q_u_e_r_y]
Print a transaction with a series of postings that balance
current totals for accounts matching the _r_e_p_o_r_t_-_q_u_e_r_y in a
special account called Equity:Opening Balances. The purpose of
this report is to close the books for a prior year, while using
these equity postings to carry forward those balances.
ppaayyeeeess [_r_e_p_o_r_t_-_q_u_e_r_y]
List all payees for postings matching the _r_e_p_o_r_t_-_q_u_e_r_y.
pprriicceemmaapp
Produce a file which can be used to generate a graph with
graphviz showing the relationship of commodities in the lleeddggeerr
file.
pprriicceess [_r_e_p_o_r_t_-_q_u_e_r_y]
Report prices for all commodities in postings matching the
_r_e_p_o_r_t_-_q_u_e_r_y. The prices are reported with the granularity of a
single day.
pprriicceeddbb [_r_e_p_o_r_t_-_q_u_e_r_y]
Report prices for all commodities in postings matching the
_r_e_p_o_r_t_-_q_u_e_r_y. Prices are reported down to the second, using the
same format as the _~_/_._p_r_i_c_e_d_b file.
pprriinntt [_r_e_p_o_r_t_-_q_u_e_r_y]
Print out the full transactions of any matching postings using
the same format as they would appear in a data file. This can
be used to extract subsets from a lleeddggeerr file to transfer to
other files.
ppuusshh [_o_p_t_i_o_n_s]
In the REPL, push a set of command-line _o_p_t_i_o_n_s, so that they
will apply to all subsequent reports.
ppoopp In the REPL, pop any option settings that have been ppuusshhed.
rreeggiisstteerr [_r_e_p_o_r_t_-_q_u_e_r_y]
List all postings matching the _r_e_p_o_r_t_-_q_u_e_r_y. This is one of the
most common commands, and can be used to provide a variety of
useful reports. Options most commonly used with this command
are:
----aavveerraaggee (--AA) Show the running average, rather than a running
total.
----ccuurrrreenntt (--cc) Don't show postings beyond the present day.
----eexxcchhaannggee _c_o_m_m_o_d_i_t_y (--XX)
Render all values in the given _c_o_m_m_o_d_i_t_y, if a
price conversion rate can be determined. Rates
are always displayed relative to the date of
the posting they are calculated for. This
means a rreeggiisstteerr report is a historical value
report. For current values, it may be
preferable to use the bbaallaannccee report.
----ggaaiinn (--GG) Show any gains (or losses) in commodity values
over time.
----hheeaadd _n_u_m_b_e_r Only show the top _n_u_m_b_e_r postings.
----hhiissttoorriiccaall (--HH)
Value commodities at the time of their
acquisition.
----iinnvveerrtt Invert the value of amounts shown.
----mmaarrkkeett (--VV) Show current market values for all amounts.
This is determined in a somewhat magical
fashion. It is probably more straightforward
to use ----eexxcchhaannggee option.
----ppeerriioodd _t_i_m_e_-_p_e_r_i_o_d (--pp)
Show postings only for the given _t_i_m_e_-_p_e_r_i_o_d.
----rreellaatteedd (--rr) Show postings that are related to those that
would have been shown. It has the effect of
displaying the "other side" of the postings.
----ssoorrtt _v_a_l_u_e_-_e_x_p_r_e_s_s_i_o_n (--SS)
Sort postings by evaluating the given
_v_a_l_u_e_-_e_x_p_r_e_s_s_i_o_n. Note that a comma-separated
list of expressions is allowed, in which case
each sorting term is used in order to determine
the final ordering. For example, to search by
date and then amount, one would use:
ledger reg --sort 'date, amount'
The sort order may be controlled with the '-'
sign. For example, to sort in reverse
chronological order:
ledger reg --sort '-date'
----ttaaiill _n_u_m_b_e_r Only show the last _n_u_m_b_e_r postings.
----uunncclleeaarreedd (--UU)
Only show uncleared (i.e., recent) postings.
There are also several grouping options that can be useful:
----bbyy--ppaayyeeee (--PP) Group postings by common payee names.
----ddaaiillyy (--DD) Group postings by day.
----wweeeekkllyy (--WW) Group postings by week (starting on Sundays).
----ssttaarrtt--ooff--wweeeekk _d_a_y
Set the start of each report grouped by week to
the given _d_a_y.
----mmoonntthhllyy (--MM) Group postings by month.
----qquuaarrtteerrllyy Group postings by fiscal quarter.
----yyeeaarrllyy (--YY) Group postings by year.
----ddaayyss--ooff--wweeeekk Group postings by the day of the week on which
they took place.
----ssuubbttoottaall (--ss) Group all postings together. This is very
similar to the totals shown by the bbaallaannccee
report.
The synonyms rreegg and rr are also accepted.
sseerrvveerr This command requires that Python support be active. If so, it
starts up an HTTP server listening for requests on port 9000.
This provides an alternate interface to creating and viewing
reports. Note that this is very much a work-in-progress, and
will not be fully functional until a later version.
sseelleecctt [_s_q_l_-_q_u_e_r_y]
List all postings matching the _s_q_l_-_q_u_e_r_y. This command allows
to generate SQL-like queries, e.g.:
ledger select date,amount from posts where
account=~/Income/
ssoouurrccee Parse a journal file and checks it for errors. lleeddggeerr will
return success if no errors are found.
ssttaattss [_r_e_p_o_r_t_-_q_u_e_r_y]
Provide summary information about all the postings matching
_r_e_p_o_r_t_-_q_u_e_r_y. It provides information such as:
++oo Time range of all matching postings
++oo Unique payees
++oo Unique accounts
++oo Postings total
++oo Uncleared postings
++oo Days since last posting
++oo Posts in the last 7 days
++oo Posts in the last 30 days
++oo Posts this month
xxmmll [_r_e_p_o_r_t_-_q_u_e_r_y]
Output data relating to the current report in XML format. It
includes all accounts and commodities involved in the report,
plus the postings and the transactions they are contained in.
See the manual for more information.
OOPPTTIIOONNSS
----aabbbbrreevv--lleenn _I_N_T
Set the minimum length an account can be abbreviated to if it
doesn't fit inside the aaccccoouunntt--wwiiddtthh. If _I_N_T is zero, then the
account name will be truncated on the right. If _I_N_T is greater
than aaccccoouunntt--wwiiddtthh then the account will be truncated on the
left, with no shortening of the account names in order to fit
into the desired width.
----aaccccoouunntt _E_X_P_R
Prepend _E_X_P_R to all accounts reported. That is, the option
----aaccccoouunntt _"_'_P_e_r_s_o_n_a_l_'_" would tack _P_e_r_s_o_n_a_l_: and ----aaccccoouunntt
_"_t_a_g_(_'_V_A_T_'_)_" would tack the value of the VAT tag to the
beginning of every account reported in a bbaallaannccee or rreeggiisstteerr
report.
----aaccccoouunntt--wwiiddtthh _I_N_T
Set the width of the account column in the rreeggiisstteerr report to
_I_N_T characters.
----aaccttuuaall (--LL)
Report only real transactions, with no automated or virtual
transactions used.
----aadddd--bbuuddggeett
Show only un-budgeted postings.
----aammoouunntt _E_X_P_R (--tt)
Apply the given value expression to the posting amount. Using
----aammoouunntt _E_X_P_R you can apply an arbitrary transformation to the
postings.
----aammoouunntt--ddaattaa (--jj)
On a register report print only the dates and amount of
postings. Useful for graphing and spreadsheet applications.
----aammoouunntt--wwiiddtthh _I_N_T
Set the width in characters of the amount column in the rreeggiisstteerr
report.
----aannoonn Anonymize registry output, mostly for sending in bug reports.
----aannssii Use color if the terminal supports it. Alias for ----ccoolloorr
----aarrggss--oonnllyy
Ignore init files and environment variables for the lleeddggeerr run.
----aauuttoo--mmaattcchh
When generating a ledger transaction from a CSV file using the
ccoonnvveerrtt command, automatically match an account from the Ledger
journal.
----aauuxx--ddaattee
Show auxiliary dates for all calculations. Alias for
----eeffffeeccttiivvee
----aavveerraaggee (--AA)
Print average values over the number of transactions instead of
running totals.
----aavveerraaggee--lloott--pprriicceess
Report the average price at which each commodity was purchased
in a balance report.
----bbaallaannccee--ffoorrmmaatt _F_M_T
Specify the format to use for the bbaallaannccee report.
----bbaassee Reduce convertible commodities down the bottom of the
conversion, e.g. display time in seconds.
----bbaassiiss (--BB)
Report the cost basis on all posting. Alias for ----ccoosstt
----bbeeggiinn _D_A_T_E (--bb)
Specify the start _D_A_T_E of all calculations. Transactions before
that date will be ignored.
----bboolldd--iiff _E_X_P_R
Print the entire line in bold if the given value expression is
true.
----bbuuddggeett
Only display budgeted items. In a rreeggiisstteerr report this displays
transaction in the budget, in a balance report this displays
accounts in the budget.
----bbuuddggeett--ffoorrmmaatt _F_M_T
Specify the format to use for the bbuuddggeett report.
----bbyy--ppaayyeeee (--PP)
Group postings in the register report by common payee names.
----cchheecckk--ppaayyeeeess
Enable strict and pedantic checking for payees as well as
accounts, commodities and tags.
----cclleeaarreedd (--CC)
Display only cleared postings.
----cclleeaarreedd--ffoorrmmaatt _F_M_T
Specify the format to use for the cclleeaarreedd report
----ccoollllaappssee (--nn)
Print only the top level accounts.
----ccoollllaappssee--iiff--zzeerroo
Collapse the account display only if it has a zero balance.
----ccoolloorr Use color if the terminal supports it. Alias for ----aannssii
----ccoolluummnnss _I_N_T
Make the rreeggiisstteerr report _I_N_T characters wide. By default lleeddggeerr
will use all available columns in your terminal.
----ccoosstt Report the cost basis on all posting. Alias for ----bbaassiiss.
----ccoouunntt Direct lleeddggeerr to report the number of items when appended to the
ccoommmmooddiittiieess, aaccccoouunnttss or ppaayyeeeess commands.
----ccssvv--ffoorrmmaatt _F_M_T
Format ccssvv report according to _F_M_T.
----ccuurrrreenntt (--cc)
Shorthand for ----lliimmiitt _'_d_a_t_e _<_= _t_o_d_a_y_'.
----ddaaiillyy (--DD)
Shorthand for ----ppeerriioodd _d_a_i_l_y.
----ddaattee _E_X_P_R
Transform the date of the transaction using _E_X_P_R.
----ddaattee--ffoorrmmaatt _D_A_T_E_F_M_T (--yy)
Print dates using _D_A_T_E_F_M_T. Refer to strftime(3) for details on
the format string syntax.
----ddaatteettiimmee--ffoorrmmaatt _D_A_T_E_T_I_M_E_F_M_T
Print datetimes using _D_A_T_E_T_I_M_E_F_M_T. Refer to strftime(3) for
details on the format string syntax.
----ddaattee--wwiiddtthh _I_N_T
Specify the width, in characters, of the date column in the
rreeggiisstteerr report.
----ddaayy--bbrreeaakk
Break up rreeggiisstteerr report of timelog entries that span multiple
days by day.
----ddaayyss--ooff--wweeeekk
Group transactions by the days of the week. Alias for ----ddooww.
----ddcc Display register or balance in debit/credit format If you use
----ddcc with either the rreeggiisstteerr or bbaallaannccee commands, you will now
get separate columns for debits and credits.
----ddeebbuugg _S_T_R
If lleeddggeerr has been built with debug options this will provide
extra data during the run.
----ddeecciimmaall--ccoommmmaa
Direct lleeddggeerr to parse journals using the European standard
comma as decimal separator, vice a period.
----ddeepptthh _I_N_T
Limit the depth of the account tree. In a balance report, for
example, ----ddeepptthh _2 will print balances only for accounts with
two levels, i.e. EExxppeennsseess::EEnntteerrttaaiinnmmeenntt but not
EExxppeennsseess::EEnntteerrttaaiinnmmeenntt::DDiinniinngg. This is a display predicate,
which means it only affects display, not the total calculations.
----ddeettaaiill
Related to ccoonnvveerrtt command. Synonym to ----rriicchh--ddaattaa option.
----ddeevviiaattiioonn
Report each posting's deviation from the average. It is only
meaningful in the rreeggiisstteerr and pprriicceess reports.
----ddiissppllaayy _E_X_P_R (--dd)
Display lines that satisfy the expression _E_X_P_R.
----ddiissppllaayy--aammoouunntt _E_X_P_R
Apply a transformation to the _d_i_s_p_l_a_y_e_d amount. This occurs
after calculations occur.
----ddiissppllaayy--ttoottaall _E_X_P_R
Apply a transformation to the _d_i_s_p_l_a_y_e_d total. This occurs
after calculations occur.
----ddooww Group transactions by the days of the week. Alias for
----ddaayyss--ooff--wweeeekk.
----ddoowwnnllooaadd
Cause quotes to be automagically downloaded, as needed, by
running a script named _g_e_t_q_u_o_t_e and expecting that script to
return a value understood by lleeddggeerr. A sample implementation of
a _g_e_t_q_u_o_t_e script, implemented in Perl, is provided in the
distribution. Downloaded quote price are then appended to the
price database, usually specified using the environment variable
LEDGER_PRICE_DB.
----eeffffeeccttiivvee
Show auxiliary dates for all calculations. Alias for
----aauuxx--ddaattee.
----eemmppttyy (--EE)
Include empty accounts in report.
----eenndd _D_A_T_E (--ee)
Constrain the report so that transactions on or after _D_A_T_E are
not considered.
----eeqquuiittyy
Related to the eeqquuiittyy command. Gives current account balances
in the form of a register report.
----eexxaacctt Report beginning and ending of periods by the date of the first
and last posting occurring in that period.
----eexxcchhaannggee _C_O_M_M_O_D_I_T_Y [, _C_O_M_M_O_D_I_T_Y_, _._._.] (--XX)
Display values in terms of the given _C_O_M_M_O_D_I_T_Y. The latest
available price is used.
----ffiillee _F_I_L_E (--ff)
Read journal data from _F_I_L_E.
----ffiirrsstt _I_N_T
Print the first _I_N_T entries. Opposite of ----llaasstt _I_N_T. Alias for
----hheeaadd.
----ffllaatt Force the full names of accounts to be used in the balance
report. The balance report will not use an indented tree.
----ffoorrccee--ccoolloorr
Output TTY color codes even if the TTY doesn't support them.
Useful for TTYs that don't advertise their capabilities
correctly.
----ffoorrccee--ppaaggeerr
Force lleeddggeerr to paginate its output.
----ffoorreeccaasstt--wwhhiillee _E_X_P_R
Continue forecasting while _V_E_X_P_R is true. Alias for ----ffoorreeccaasstt.
----ffoorreeccaasstt--yyeeaarrss _I_N_T
Forecast at most _I_N_T years into the future.
----ffoorrmmaatt _F_M_T (--FF)
Use the given format string _F_M_T to print output.
----ggaaiinn (--GG)
Report net gain or loss for commodities that have a price
history.
----ggeenneerraatteedd
Include auto-generated postings (such as those from automated
transactions) in the report, in cases where you normally
wouldn't want them.
----ggrroouupp--bbyy _E_X_P_R
Group transaction together in the rreeggiisstteerr report. _E_X_P_R can be
anything, although most common would be _p_a_y_e_e or _c_o_m_m_o_d_i_t_y. The
ttaagg() function is also useful here.
----ggrroouupp--ttiittllee--ffoorrmmaatt _F_M_T
Set the format for the headers that separate reports section of
a grouped report. Only has effect with a ----ggrroouupp--bbyy _E_X_P_R
register report.
----hheeaadd _I_N_T
Print the first _I_N_T entries. Opposite of ----ttaaiill _I_N_T. Alias for
----ffiirrsstt
----hheellpp Print this man page.
----iimmmmeeddiiaattee
Evaluate calculations immediately rather than lazily.
----iimmppoorrtt _F_I_L_E
Import _F_I_L_E as Python module.
----iinniitt--ffiillee _F_I_L_E (--ii)
Read _F_I_L_E before any other lleeddggeerr file. This file may not
contain any postings, but it may contain option settings. To
specify options in the init file, use the same syntax as the
command-line, but put each option on its own line.
----iinnjjeecctt _S_T_R
Use _S_T_R amounts in calculations. In case you know what amount a
transaction should be, but the actual transaction has the wrong
value you can use metadata _S_T_R to specify the expected amount.
----iinnppuutt--ddaattee--ffoorrmmaatt _D_A_T_E_F_M_T
Specify the input date format for journal entries.
----iinnvveerrtt
Change the sign of all reported values.
----llaasstt _I_N_T.
Report only the last _I_N_T entries. Opposite of ----ffiirrsstt _I_N_T.
Only useful on a register report. Alias for ----ttaaiill.
----lleeeewwaayy _I_N_T (--ZZ)
Alias for ----pprriiccee--eexxpprr.
----lliimmiitt _E_X_P_R (--ll)
Limit postings in calculations.
----lloott--ddaatteess
Report the date on which each commodity in a balance report was
purchased.
----lloott--nnootteess
Report the tag attached to each commodity in a balance report.
----lloott--pprriicceess
Report the price at which each commodity in a balance report was
purchased.
----lloottss Report the date and price at which each commodity was purchased
in a balance report.
----lloottss--aaccttuuaall
Preserve the uniqueness of commodities so they aren't merged
during reporting without printing the lot annotations.
----mmaarrkkeett (--VV)
Use the latest market value for all commodities.
----mmaasstteerr--aaccccoouunntt _S_T_R
Prepend all account names with _S_T_R
----mmeettaa _S_T_R
In the register report, prepend the transaction with the value
of the given tag _S_T_R.
----mmeettaa--wwiiddtthh _I_N_T
Specify the width of the Meta column used for the ----mmeettaa _T_A_G
options.
----mmoonntthhllyy (--MM)
Shorthand for ----ppeerriioodd _m_o_n_t_h_l_y.
----nnoo--aalliiaasseess
Aliases are completely ignored.
----nnoo--ccoolloorr
Suppress any color TTY output.
----nnoo--ppaaggeerr
Disables the pager on TTY output.
----nnoo--rreevvaalluueedd
Stop lleeddggeerr from showing <Revalued> postings.
----nnoo--rroouunnddiinngg
Don't output "<Adjustment>" postings. Note that this will cause
the running total to often not add up! Its main use is for
----aammoouunntt--ddaattaa (--jj) and ----ttoottaall--ddaattaa (--JJ) reports.
----nnoo--ttiittlleess
Suppress the output of group titles.
----nnoo--ttoottaall
Suppress printing the final total line in a balance report.
----nnooww _D_A_T_E
Use _D_A_T_E as the current date. This affects the output when
using ----ppeerriioodd, ----bbeeggiinn, ----eenndd, or ----ccuurrrreenntt to decide which
dates lie in the past or future.
----oonnllyy _E_X_P_R
This is a postings predicate that applies after certain
transforms have been executed, such as periodic gathering.
----ooppttiioonnss
Display the options in effect for this lleeddggeerr invocation, along
with their values and the source of those values.
----oouuttppuutt _F_I_L_E (--oo)
Redirect the output of lleeddggeerr to _F_I_L_E.
----ppaaggeerr _S_T_R
Use _S_T_R as the pager program.
----ppaayyeeee Sets a value expression for formatting the payee. In the
rreeggiisstteerr report this prevents the second entry from having a
date and payee for each transaction.
----ppaayyeeee--wwiiddtthh _I_N_T
Set the number of columns dedicated to the payee in the register
report to _I_N_T.
----ppeeddaannttiicc
Accounts, tags or commodities not previously declared will cause
errors.
----ppeennddiinngg
Use only postings that are marked pending.
----ppeerrcceenntt (--%%)
Calculate the percentage value of each account in a balance
reports. Only works for account that have a single commodity.
----ppeerriioodd _P_E_R_I_O_D (--pp)
Define a period expression that sets the time period during
which transactions are to be accounted. For a rreeggiisstteerr report
only the transactions that satisfy the period expression with be
displayed. For a balance report only those transactions will be
accounted in the final balances.
----ppeerriioodd--ssoorrtt
Sort the posting within transactions using the given value
expression.
----ppeerrmmiissssiivvee
Quiet balance assertions.
----ppiivvoott _T_A_G
Produce a balance pivot report "around" the given _T_A_G.
----pplloott--aammoouunntt--ffoorrmmaatt _F_M_T
Define the output format for an amount data plot.
----pplloott--ttoottaall--ffoorrmmaatt _F_M_T
Define the output format for a total data plot.
----pprreeppeenndd--ffoorrmmaatt _F_M_T
Prepend _F_M_T to every line of the output.
----pprreeppeenndd--wwiiddtthh _I_N_T
Reserve _I_N_T spaces at the beginning of each line of the output.
----pprriiccee (--II)
Use the price of the commodity purchase for performing
calculations.
----pprriiccee--ddbb _F_I_L_E
----pprriiccee--eexxpp _S_T_R (--ZZ)
Set the expected freshness of price quotes, in _I_N_T minutes.
That is, if the last known quote for any commodity is older than
this value, and if ----ddoowwnnllooaadd is being used, then the Internet
will be consulted again for a newer price. Otherwise, the old
price is still considered to be fresh enough. Alias for
----lleeeewwaayy.
----pprriicceess--ffoorrmmaatt _F_M_T
Set the format for the pprriicceess report.
----pprriicceeddbb--ffoorrmmaatt _F_M_T
Set the format expected for the historical price file.
----pprriimmaarryy--ddaattee
Show primary dates for all calculations. Alias for
----aaccttuuaall--ddaatteess
----qquuaannttiittyy (--OO)
Report commodity totals (this is the default).
----qquuaarrtteerrllyy
Shorthand for ----ppeerriioodd _q_u_a_r_t_e_r_l_y.
----rraaww In the pprriinntt report, show transactions using the exact same
syntax as specified by the user in their data file. Don't do
any massaging or interpreting. Can be useful for minor
cleanups, like just aligning amounts.
----rreeaall (--RR)
Account using only real transactions ignoring virtual and
automatic transactions.
----rreeccuurrssiivvee--aalliiaasseess
Causes lleeddggeerr to try to expand aliases recursively, i.e. try to
expand the result of an earlier expansion again, until no more
expansions apply.
----rreeggiisstteerr--ffoorrmmaatt _F_M_T
Define the output format for the rreeggiisstteerr report.
----rreellaatteedd (--rr)
In a register report show the related account. This is the
other _s_i_d_e of the transaction.
----rreellaatteedd--aallll
Show all postings in a transaction, similar to ----rreellaatteedd but
show both sides of each transaction.
----rreevvaalluueedd
Report discrepancy in values for manual reports by inserting
<Revalued> postings. This is implied when using the ----eexxcchhaannggee
(--XX) or ----mmaarrkkeett (--VV) option.
----rreevvaalluueedd--oonnllyy
Show only <Revalued> postings.
----rreevvaalluueedd--ttoottaall
Display the sum of the revalued postings as the running total,
which serves to show unrealized capital in a gain/losses report.
----rriicchh--ddaattaa
When generating a ledger transaction from a CSV file using the
ccoonnvveerrtt command, add CSV, Imported, and UUID meta-data.
----sseeeedd _I_N_T
Set the random seed to _I_N_T for the ggeenneerraattee command. Used as
part of development testing.
----ssccrriipptt _F_I_L_E
Execute a lleeddggeerr script.
----ssoorrtt _E_X_P_R (--SS)
Sort the register report based on the value expression _E_X_P_R.
----ssoorrtt--xxaaccttss
Sort the posting within transactions using the given value
expression.
----ssttaarrtt--ooff--wweeeekk _S_T_R
Use _S_T_R as the particular day of the week to start when using
the ----wweeeekkllyy option. _S_T_R can be day names, their abbreviations
like "Mon", or the weekday number starting at 0 for Sunday.
----ssttrriicctt
Accounts, tags or commodities not previously declared will cause
warnings.
----ssuubbttoottaall (--ss)
Report register as a single subtotal.
----ttaaiill _I_N_T
Report only the last _I_N_T entries. Only useful on a register
report. Alias for ----llaasstt _I_N_T
----ttiimmee--ccoolloonn
Display the value for commodities based on seconds as hours and
minutes. Thus 8100s will be displayed as 2:15h instead of
2.25h.
----ttiimmee--rreeppoorrtt
Add two columns to the bbaallaannccee report to show the earliest
checkin and checkout times for timelog entries.
----ttoottaall _E_X_P_R (--TT)
Define a value expression used to calculate the total in
reports.
----ttoottaall--ddaattaa (--JJ)
Show only dates and totals to format the output for plots.
----ttoottaall--wwiiddtthh _I_N_T
Set the width of the total field in the register report.
----ttrraaccee _I_N_T
Enable tracing. The _I_N_T specifies the level of trace desired.
----ttrruunnccaattee _S_T_R
Indicates how truncation should happen when the contents of
columns exceed their width. Valid arguments for _S_T_R are
_l_e_a_d_i_n_g, _m_i_d_d_l_e, and _t_r_a_i_l_i_n_g. The default is smarter than any
of these three, as it considers sub-names within the account
name (that style is called "abbreviate").
----uunnbbuuddggeetteedd
Show only un-budgeted postings.
----uunncclleeaarreedd (--UU)
Use only uncleared transactions in calculations and reports.
----uunnrreeaalliizzeedd
Show generated unrealized gain and loss accounts in the balance
report.
----uunnrreeaalliizzeedd--ggaaiinnss
Allow the user to specify what account name should be used for
unrealized gains. Defaults to EEqquuiittyy::UUnnrreeaalliizzeedd GGaaiinnss. Often
set in one's _~_/_._l_e_d_g_e_r_r_c file to change the default.
----uunnrreeaalliizzeedd--lloosssseess
Allow the user to specify what account name should be used for
unrealized losses. Defaults to EEqquuiittyy::UUnnrreeaalliizzeedd LLoosssseess. Often
set in one's _~_/_._l_e_d_g_e_r_r_c file to change the default.
----uunnrroouunndd
Perform all calculations without rounding and display results to
full precision.
----vvaalluueess
Show the values used by each tag when used in combination with
the ttaaggss command.
----vvaalluuee--eexxpprr _E_X_P_R
Set a global value expression annotation.
----vveerrbboossee
Print detailed information on the execution of lleeddggeerr.
----vveerriiffyy
Enable additional assertions during run-time. This causes a
significant slowdown. When combined with ----ddeebbuugg _C_O_D_E lleeddggeerr
will produce memory trace information.
----vveerriiffyy--mmeemmoorryy
Verify that every constructed object is properly destructed.
This is for debugging purposes only.
----vveerrssiioonn
Print version information and exit.
----wweeeekkllyy (--WW)
Shorthand for ----ppeerriioodd _w_e_e_k_l_y.
----wwiiddee (--ww)
Assume 132 columns instead of the TTY width.
----yyeeaarrllyy (--YY)
Shorthand for ----ppeerriioodd _y_e_a_r_l_y.
PPRREE--CCOOMMMMAANNDDSS
Pre-commands are useful when you aren't sure how a command or option will
work. The difference between a pre-command and a regular command is that
pre-commands ignore the journal data file completely, nor is the user's
init file read.
aarrggss / qquueerryy
Evaluate the given arguments and report how lleeddggeerr interprets it
against the following model transaction:
2004/05/27 Book Store
; This note applies to all postings. :SecondTag:
Expenses:Books 20 BOOK @ $10
; Metadata: Some Value
; Typed:: $100 + $200
; :ExampleTag:
; Here follows a note describing the posting.
Liabilities:MasterCard $-200.00
eevvaall Evaluate the given value expression against the model
transaction.
ffoorrmmaatt Print details of how lleeddggeerr uses the given formatting
description and apply it against a model transaction.
ppaarrssee / eexxpprr
Print details of how lleeddggeerr uses the given value expression
description and apply it against a model transaction.
ggeenneerraattee
Randomly generates syntactically valid lleeddggeerr data from a seed.
Used by the GenerateTests harness for development testing.
ppeerriioodd Evaluate the given period and report how lleeddggeerr interprets it.
tteemmppllaattee
Shows the insertion template that the xxaacctt command generates.
This is a debugging command.
QQUUEERRIIEESS
The syntax for reporting queries can get somewhat complex. It is a
series of query terms with an implicit OR operator between them. The
following terms are accepted:
_r_e_g_e_x A bare string is taken as a regular expression matching
the full account name. Thus, to report the current
balance for all assets and liabilities, you would use:
ledger bal asset liab
ppaayyeeee _r_e_g_e_x (@@_r_e_g_e_x)
Query on the payee, rather than the account.
ttaagg _r_e_g_e_x (%%_r_e_g_e_x)
Query on tags.
nnoottee _r_e_g_e_x (==_r_e_g_e_x)
Query on anything found in an item's note.
ccooddee _r_e_g_e_x (##_r_e_g_e_x)
Query on the xact's optional code (which can be any string
the user wishes).
_t_e_r_m aanndd _t_e_r_m Query terms are joined by an implicit OR operator. You
can change this to AND by using the aanndd keyword. For
example, to show food expenditures occurring at Shakee's
Pizza, you could say:
ledger reg food and @Shakee
_t_e_r_m oorr _t_e_r_m When you wish to be more explicit, use the OR operator.
sshhooww
nnoott _t_e_r_m Reverse the logical meaning of the following term. This
can be used with parentheses to great effect:
ledger reg food and @Shakee and not dining
( _t_e_r_m ) If you wish to mix OR and AND operators, it is often
helpful to surround logical units with parentheses. NNOOTTEE:
Because of the way some shells interpret parentheses, you
should always escape them:
ledger bal \( assets or liab \) and not food
EEXXPPRREESSSSIIOONNSS
aabbss(_v_a_l_u_e) Return the absolute value of the given _v_a_l_u_e.
aaccccoouunntt Return the posting's account.
aaccccoouunntt__bbaassee Return the base account, i.e. everything after the last
account delimiter ':'.
aaccttuuaall Return true if the transaction is real, i.e not an
automated or virtual transaction, false otherwise.
aammoouunntt Return the amount of the posting.
aammoouunntt__eexxpprr Return the calculated amount of the posting according to
the ----aammoouunntt option.
aannssiiffyy__iiff(_v_a_l_u_e, _c_o_l_o_r, _b_o_o_l)
Render the given _v_a_l_u_e as a string, applying the proper
ANSI escape codes to display it in the given _c_o_l_o_r if
_b_o_o_l is true. It typically checks the value of the
option ----ccoolloorr, for example:
ansify_if(amount, blue, options.color)
bbeegg__lliinnee Line number where entry for posting begins.
bbeegg__ppooss Character position where entry for posting begins.
cceeiilliinngg(_v_a_l_u_e) Return the next integer of _v_a_l_u_e toward +infinity.
cclleeaarreedd Return true if the posting was cleared, false otherwise.
ccooddee Return the transaction code, the string between the
parenthesis after the date.
ccoommmmooddiittyy(_v_a_l_u_e)
Return the commodity of _v_a_l_u_e or the posting amount when
_v_a_l_u_e was not specified.
ddaattee Return the date of the posting.
eenndd__lliinnee Line number where entry for posting ends.
eenndd__ppooss Character position where entry for posting ends.
fflloooorr(_v_a_l_u_e) Return the next integer of _v_a_l_u_e toward -infinity.
ffiilleennaammee The name of the lleeddggeerr data file from whence the posting
came.
ffoorrmmaatt(_s_t_r_i_n_g) Evaluate _s_t_r_i_n_g as format just like the ----ffoorrmmaatt option.
ffoorrmmaatt__ddaattee(_d_a_t_e, _f_o_r_m_a_t)
Return the _d_a_t_e as a string using _f_o_r_m_a_t. Refer to
strftime(3) for format string details.
ffoorrmmaatt__ddaatteettiimmee(_d_a_t_e_t_i_m_e, _f_o_r_m_a_t)
Return the _d_a_t_e_t_i_m_e as a string using _f_o_r_m_a_t. Refer to
strftime(3) for format string details.
ggeett__aatt(_s_e_q, _i_n_d_e_x)
Return value at _i_n_d_e_x from _s_e_q. Used internally to
construct different reports.
hhaass__mmeettaa(_t_a_g) Return true if the posting has metadata named _t_a_g, false
otherwise.
hhaass__ttaagg(_t_a_g) Return true if the posting has metadata named _t_a_g, false
otherwise.
iiss__sseeqq(_v_a_l_u_e) Return true if _v_a_l_u_e is a sequence. Used internally.