Skip to content

Instantly share code, notes, and snippets.

@drhodes
Last active April 13, 2020 14:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhodes/1673187 to your computer and use it in GitHub Desktop.
Save drhodes/1673187 to your computer and use it in GitHub Desktop.
lolcate, comically fast file locater sometimes two orders of magnitude faster than mlocate
#!/bin/bash
# Please read to make sure you really want to use this program
# it hasn't been tested.
# Requires lzop
mkdir -p ~/.lolcate
case "$1" in
# ------------------------------------------------------------------
--help)
echo "usage: lolcate"
echo "$ lolcate updatedb to update"
echo "$ lolcate <pattern> to search"
echo "$ lolcate --help for this help"
exit 1
;;
"")
lolcate --help
exit 1
;;
# ------------------------------------------------------------------
updatedb)
echo "updating data file"
mkdir -p ~/.lolcate
find / | lzop -1 > ~/.lolcate/files.lzop
;;
# ------------------------------------------------------------------
*)
lzop -dc ~/.lolcate/files.lzop | grep $1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment