Ledger has a very simple command-line interface, named—enticing enough—ledger. It supports a few reporting commands, and a large number of options for refining the output from those commands. The basic syntax of any ledger command is:
ledger [OPTIONS...] COMMAND [ARGS...]
Command options must always precede the command word. After the command word there may appear any number of arguments. For most commands, these arguments are regular expressions that cause the output to relate only to transactions matching those regular expressions. For the entry command, the arguments have a special meaning, described below.
The regular expressions arguments always match the account name that a transaction refers to. To match on the payee of the entry instead, precede the regular expression with ‘--’. For example, the following balance command reports account totals for rent, food and movies, but only those whose payee matches Freddie:
ledger bal rent food movies -- freddie
There are many, many command options available with the ledger command, and it takes a while to master them. However, none of them are required to use the basic reporting commands.