Keeping a budget allows you to pay closer attention to your income and
expenses, by reporting how far your actual financial activity is from
your expectations.

To start keeping a budget, put some period transactions at the top of your
ledger file.  A period transaction is almost identical to a regular transaction,
except that it begins with a tilde and has a period expression in
place of a payee.  For example:

@smallexample
~ Monthly
  Expenses:Rent               $500.00
  Expenses:Food               $450.00
  Expenses:Auto:Gas           $120.00
  Expenses:Insurance          $150.00
  Expenses:Phone              $125.00
  Expenses:Utilities          $100.00
  Expenses:Movies              $50.00
  Expenses                    $200.00  ; all other expenses
  Assets

~ Yearly
  Expenses:Auto:Repair        $500.00
  Assets
@end smallexample

These two period transactions give the usual monthly expenses, as well as
one typical yearly expense.  For help on finding out what your average
monthly expense is for any category, use a command like:

@example
ledger -p "this year" -MAs bal ^expenses
@end example

The reported totals are the current year's average for each account.

Once these period transactions are defined, creating a budget report is as
easy as adding @option{--budget} to the command-line.  For example, a
typical monthly expense report would be:

@example
ledger -M reg ^exp
@end example

To see the same report balanced against your budget, use:

@example
ledger --budget -M reg ^exp
@end example

A budget report includes only those accounts that appear in the
budget.  To see all expenses balanced against the budget, use
@option{--add-budget}.  You can even see only the unbudgeted expenses
using @option{--unbudgeted}:

@example
ledger --unbudgeted -M reg ^exp
@end example

You can also use these flags with the @command{balance} command.