Created
June 4, 2020 06:57
-
-
Save loplex/a2226b51bbc9ee039c46a0989a73f1f2 to your computer and use it in GitHub Desktop.
locate command filtered to directories only
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/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