semind(1)
π semind(1) β Semantic Indexer for C π
okay bestie, sit down, hydrate, and let me tell you about semind β it's the C semantic indexer from the General Commands Manual, and it's literally about to change your whole grep-until-you-cry lifestyle. π¦
β¨ NAME β¨
semind β Semantic Indexer for C. that's it, that's the name, short and iconic. π
πΈ SYNOPSIS πΈ
semind [options]
semind [options] add [command options] [--] [compiler options] [files...]
semind [options] rm [command options] pattern
semind [options] search [command options] [pattern]
semind [options] search [command options] (-e|-l) filename:linenr:column
look at her go. five whole ways to run her. pick your fighter. π
π«Ά DESCRIPTION π«Ά
so semind is the simple to use cscope-like tool built on top of sparse/dissect. bestie it's giving cscope but with β¨loreβ¨.
here's the tea though β unlike cscope, it runs after the pre-processor, which means it can't index the code that got filtered out by ifdef's π (rip those branches, gone but not forgotten). but on the other hand?? otoh?? it actually understands how a symbol is used, and it can track the usage of struct members. not me being obsessed with a struct member tracker fr fr. π₯
π SUBCOMMANDS π
addβ generates or updates the semantic index file. she builds, she maintains, she slays. πrmβ removes files from the index by pattern. the pattern is aglob(7)wildcard pattern. bye bestie πsearchβ queries information about a symbol by pattern. the pattern is aglob(7)wildcard pattern. this is the main character moment honestly. π
π COMMON OPTIONS π
these work no matter which subcommand you're on. universal queen behavior. π
-D,--database=FILEβ specify the database file (default:./semind.sqlite). yes she defaults to dropping a whole sqlite file right in your cwd, she's confident like that. π-v,--verboseβ show information about what is being done. she'll narrate her own life. we love a transparent icon. π£οΈ-h,--helpβ show this text and exit. classic, timeless, never not useful.
π ADD OPTIONS π
extra goodies for the add subcommand only.
--include-local-symsβ include into the index local symbols. yes, the little local ones too. bring everybody to the party. π
π¦ SEARCH OPTIONS π¦
the search subcommand's own little toolkit. π
-f,--format=STRINGβ specify an output format. Default:(%m) %f\t%l\t%c\t%C\t%s(see FORMAT below). you can absolutely customize this, go off. β¨-p,--path=PATTERNβ search symbols only in specified directories. narrow that search down, stay focused bestie. π―-m,--mode=MODEβ search only the specified type of access (see MODE below). read? write? both? you decide. π-k,--kind=KINDβ specify a kind of symbol (see KIND below). functions? members? strict? pick one. π-e,--explainβ Show what happens in the specified file position; π-l,--locationβ Show usage of symbols from a specific file position; π-v,--verboseβ show information about what is being done; (yes she's here too, she gets around) π£οΈ-h,--helpβ show this text and exit. always here for you. π«Ά
β FORMAT β
these are the little placeholders you can drop into your --format string. mix and match, make it cute. β¨
%mβ access mode in human readable form (see MODE below). π%fβ file name. π%lβ line number. π’%cβ column number. π%Cβ the name of the function in which the symbol occurs. π§%nβ symbol name. π·οΈ%sβ source code line. heads up bestie: the indexer does not save source code lines β they're read from the file during the search. so if the file's gone, that line's gone. no cap. π
π KIND π
the --kind values, short and sweet:
fβ functionsβ strictmβ struct member
π§ MODE π§
okay so MODE gets dumped as a 3-letter string. and the letters mean:
- the first letter denotes the address of part
- the 2nd β access by value
- the 3rd β access by pointer
and then there's a special value, 'def', which means a symbol definition. periodt. β¨
the actual mode letters:
rβ readwβ writemβ read and write
π SEE ALSO π
sparse(1)β her origin story, go read it. π«Ά
π HOMEPAGE π
https://sparse.docs.kernel.org β go touch grass (the documentation kind). π±
π MAILING LIST π
linux-sparse@vger.kernel.org β slide into the inbox, they don't bite. π
ok that's the whole page bestie, every flag, every letter, every default, all of it. go index something and feel powerful. π β¨
and that's a wrap on the semind(1) page from the General Commands Manual β you've reached the end, mwah, bye bye, go forth and search. ππ¦π
π¦ where this page comes from
- arch rolling: sparse 0.6.5+rc1-3 Β· MIT
- debian bookworm: sparse 0.6.4-3 Β· MIT
- debian trixie: sparse 0.6.4-5 Β· MIT
- epel 9: sparse 0.6.4-3.el9 Β· MIT
- fedora 43: sparse 0.6.4-4.gce1a6720f69e.fc43.6 Β· MIT
- fedora 44: sparse 0.6.4-4.gce1a6720f69e.fc44.7 Β· MIT
- nixos 26.05: smatch 1.74
- nixos 26.05: sparse 0.6.4-unstable-2024-02-03
- nixpkgs unstable: smatch 1.75
- nixpkgs unstable: sparse 0.6.5-rc1-unstable-2025-12-18
- opensuse-leap 16.0: sparse 0.6.4+20240203-bp160.1.12 Β· MIT
- opensuse-leap 16.0: sparse 0.6.4+20240203-bp160.1.12 Β· MIT
- opensuse-leap 16.0: sparse 0.6.4+20240203-bp160.1.12 Β· MIT
- opensuse-leap 16.0: sparse 0.6.4+20240203-bp160.1.12 Β· MIT
- ubuntu jammy: sparse 0.6.4-2 Β· MIT
- ubuntu noble: sparse 0.6.4-4ubuntu3 Β· MIT
- ubuntu questing: sparse 0.6.4-5ubuntu2
- ubuntu resolute: sparse 0.6.4-5ubuntu3 Β· MIT
- ubuntu stonking: sparse 0.6.4-5ubuntu3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms