Files
cheatsheet-tldr/tldr/linux/lid.idutils
2025-12-29 00:23:53 +00:00

35 lines
818 B
Plaintext

---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# lid
> Query an ID database for tokens matching a pattern.
> Note: An ID database must first be built using `mkid`.
> More information: <https://www.gnu.org/software/idutils/manual/html_node/lid-invocation.html>.
- List all tokens and their file locations in the ID database:
`lid`
- Find files containing a specific token:
`lid {{token}}`
- Find tokens matching a pattern, ignoring case:
`lid {{[-i|--ignore-case]}} {{token}}`
- Find tokens matching an extended regular expression:
`lid {{[-r|--regexp]}} "{{pattern}}"`
- Output matching lines in grep-style format:
`lid {{[-R|--result]}} grep {{token}}`
- Find tokens that appear only once (useful for finding unused definitions):
`lid {{[-F|--frequency]}} 1`