Skip to content

Instantly share code, notes, and snippets.

@loplex
Created June 4, 2020 06:57
Show Gist options
  • Save loplex/a2226b51bbc9ee039c46a0989a73f1f2 to your computer and use it in GitHub Desktop.
Save loplex/a2226b51bbc9ee039c46a0989a73f1f2 to your computer and use it in GitHub Desktop.
locate command filtered to directories only
#!/bin/sh
for directory in `locate $@`; do
if [ -d "$directory" ]; then echo $directory; fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment