The most common use of the register command is to summarize
postings based on the account(s) they affect.  Using
@file{sample.dat} as as example, we could look at all book purchases
using:

@example
ledger reg books
@end example

Reports:

@smallexample
2004/05/29 Book Store           Expenses:Books               $20.00       $20.00
@end smallexample

If a double-dash (@samp{--}) occurs in the list of regular
expressions, any following arguments are matched against payee names,
instead of account names:

@example
ledger reg ^liab -- credit
@end example

Reports:

@smallexample
2004/05/29 Credit card company  Liabilities:MasterCard       $20.00       $20.00
@end smallexample

There are many reporting options for tailoring which postings are
found, and also how to summarize the various amounts and totals that
result.  These are plumbed in greater depth below.