Next: Report filtering, Previous: Options, Up: Options [Contents]
These are the most basic command options. Most likely, the user will want to set them using Environment variables, instead of using actual command-line options:
--help (-h) prints a summary of all the options, and what they are used for. This can be a handy way to remember which options do what. This help screen is also printed if ledger is run without a command.
--version (-v) prints the current version of ledger and exits. This is useful for sending bug reports, to let the author know which version of ledger you are using.
--file FILE (-f FILE) reads FILE as a ledger file.
Typically, the environment variable
LEDGER_FILE
is set, rather than using this command-line option.
--output FILE (-o FILE) redirects output from any command to FILE. By default, all output goes to standard output.
--init-file FILE (-i FILE) causes FILE to be read by ledger before any other ledger file. This file may not contain any transactions, 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 it’s own line. Here’s an example init file:
--price-db ~/finance/.pricedb --pager /usr/bin/less ; ~/.ledgerrc ends here
Option settings on the command-line or in the environment always take precedence over settings in the init file.
--cache FILE identifies FILE as the default binary cache
file. That is, if the ledger file to be read is specified using the
environment variable LEDGER_FILE
, then whenever a command is
finished a binary copy will be written to the specified cache, to
speed up the loading time of subsequent queries. This filename can
also be given using the environment variable LEDGER_CACHE
, or by
putting the option into your init file. The --no-cache
option causes Ledger to always ignore the binary cache.
--account NAME (-a NAME) specifies the default account which QIF file transactions are assumed to relate to.
Next: Report filtering, Previous: Options, Up: Options [Contents]