CINDEX(1)

πŸ’– CINDEX(1) β€” the trigram index glow-up πŸ’–

okay bestie, sit down, because cindex is about to become your new main character. it's a General Commands Manual girlie, and she's here to prep the trigram index for csearch(1). yes, that's the whole job. and she EATS. πŸ“


✨ NAME ✨

cindex β€” prepares the trigram index for csearch(1)


🌸 SYNOPSIS 🌸

cindex [-list] [-reset] [ path...  ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. cindex prepares the trigram index for use by csearch. the index is literally the file named by $CSEARCHINDEX, or else $HOME/.csearchindex. that's where all the magic lives, no cap. πŸ’…

the simplest invocation is, and i cannot stress this enough:

cindex path...

which adds the file or directory tree named by each path to the index. for example:

cindex $HOME/src /usr/include

or, equivalently (same energy, different font):

cindex $HOME/src
cindex /usr/include

if cindex is invoked with no paths, it reindexes the paths that have already been added, in case the files have changed. thus, cindex by itself is a useful command to run in a nightly cron job. yes bestie, the cron job. she's lowkey iconic for that. πŸ‘‘

the -list flag causes cindex to list the paths it has indexed and exit. that's it. that's the flag. πŸŽ€

by default cindex adds the named paths to the index but preserves information about other paths that might already be indexed (the ones printed by cindex -list). the -reset flag causes cindex to delete the existing index before indexing the new paths. with no path arguments, cindex -reset removes the index. gone. poof. πŸ’€


πŸŽ€ OPTIONS πŸŽ€

  • -list β€” List the indexed paths and exit. she shows you the receipts and then dips. 🫢
  • -reset β€” Delete the existing index before indexing the new paths. With no path arguments, -reset removes the index. nuclear option, but make it cute. πŸ”₯

🌈 ENVIRONMENT 🌈

cindex uses the index stored in $CSEARCHINDEX or, if that variable is unset or empty, $HOME/.csearchindex. so like, set it or don't, she's flexible. πŸ’œ

furthermore, cindex honors the standard TMPDIR environment variable when creating its temporary files. in case the temporary files exceed the space you have in /tmp, possibly because /tmp is a tmpfs and thus using your RAM, feel free to set TMPDIR to a different path than /tmp. bestie, if your /tmp is eating your RAM, that's your sign. πŸ™ˆ


⭐ SEE ALSO ⭐

csearch(1), cgrep(1).


πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others).


and that's the whole page, bestie. this one's dated 2013-06-23 and she's a CINDEX(1) girlie through and through β€” written for the Debian project, though the cool kids elsewhere can use her too. mwah. πŸ’–βœ¨