Linux command
hledger-accounts 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List all accounts
hledger accounts
List accounts from specific file
hledger accounts -f [journal.ledger]
List accounts matching pattern
hledger accounts [expenses]
List with depth limit
hledger accounts --depth [2]
Show account tree
hledger accounts --tree
List used accounts only
hledger accounts --used
List declared accounts only
hledger accounts --declared
Show accounts with their types
hledger accounts --types
Drop first N account name components
hledger accounts --drop [1]
说明
hledger accounts lists account names from the journal. Part of the hledger plain text accounting tool. It shows accounts that are declared (with account directives), posted to, or both (the default). Accounts can be filtered by query pattern, limited by depth, and displayed as a flat list or tree.
参数
- -f, --file _file_
- Use specified journal file.
- --depth _n_
- Limit account depth shown.
- --tree
- Show accounts as tree structure.
- --used
- Show only accounts with transactions.
- --declared
- Show only accounts declared with account directives.
- --flat
- Show accounts as a flat list with full names (default).
- --drop _n_
- In flat mode, omit the first n account name components.
- --types
- Show each account's type, if known.
FAQ
What is the hledger-accounts command used for?
hledger accounts lists account names from the journal. Part of the hledger plain text accounting tool. It shows accounts that are declared (with account directives), posted to, or both (the default). Accounts can be filtered by query pattern, limited by depth, and displayed as a flat list or tree.
How do I run a basic hledger-accounts example?
Run `hledger accounts` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --file _file_ do in hledger-accounts?
Use specified journal file.