mkid
Create an identifier database
TLDR
Build an ID database for the current directory
Build an ID database for specific directories
Build an ID database and save it to a specific file
Include only specific languages
Exclude specific directories from indexing
Display statistics after building the database
SYNOPSIS
mkid [-v] [file …]
PARAMETERS
-v
Enable verbose output, printing progress during indexing.
DESCRIPTION
mkid is a utility from the id-utils package that generates a compact ID database file for fast searching of identifiers in C/C++ source code. It extracts symbols like functions, variables, typedefs, and macros from source files, storing them in a sorted list for binary search.
Primarily used with id(1) (identifier search) and gid(1) (global identifier search across directories), it speeds up navigation in large codebases without the overhead of recursive grep. The database ignores comments and strings, focusing on valid C identifiers.
By default, without arguments, mkid indexes all files matching *.c, *.h, *.y, or *.l in the current directory. Specify files explicitly for targeted indexing. Re-run after code changes to update the database.
CAVEATS
Limited to C-style identifiers; does not index strings, comments, or non-C files effectively. Default behavior scans only current directory—use explicit paths for subdirs. Database (ID) overwrites if exists; no append mode.
DEFAULT INDEXING
Without files, processes all *.c, *.h, *.y, *.l in current directory.
OUTPUT
Generates ID file (binary searchable database) in current directory.
HISTORY
Part of id-utils by Dean Roehrich, originally released in 1993. Designed for efficient code searching pre-IDE era; remains lightweight alternative to ctags or modern tools.
SEE ALSO
id(1), gid(1)


