Accounts
Run ledger -f ledger.dat accounts
to see an account list.
Assets
Assets:Bank
Assets:Bank:Checking
Assets:Cash
Assets:Cash:Wallet
Assets:Crypto
Assets:Crypto:BTC
Assets:Crypto:ETH
Equity
Equity:Opening Balances
Expenses
Expenses:Books
Expenses:Food
Expenses:Food:Groceries
Expenses:Food:TakeOut
Income
Income:Salary
Liabilities
Liabilities:MasterCard
Only Leaf (Max Depth) Accounts
If we are only interested in the highest depth accounts and not interested
in seeing all the parent account levels we can get that, just
run ledger -f ledger.dat accounts -l
Assets:Bank:Checking
Assets:Cash:Wallet
Assets:Crypto:BTC
Assets:Crypto:ETH
Equity:Opening Balances
Expenses:Books
Expenses:Food:Groceries
Expenses:Food:TakeOut
Income:Salary
Liabilities:MasterCard
Matching Depth Accounts
This is mostly useful for autocomplete functions. You can use this to get accounts matching a filter, and at the same depth as the filter.
For instance, let's get all Assets accounts by running
ledger -f ledger.dat accounts -m Assets:
Assets:Bank
Assets:Cash
Assets:Crypto