Last active
April 13, 2020 14:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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