-
-
Save ruario/21c611b5a7cd2b5ae6b0 to your computer and use it in GitHub Desktop.
Finds all empty directories in /usr/local that are not defined by the Filesystem Hierarchy Standard version 3.0
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 | |
while read d; do | |
if ! ls -A "$d" | grep -q ^; then | |
if [ ! -h "$d" ]; then | |
echo "$d is an empty, non FHS 3.0 directory" | |
fi | |
fi | |
done < <(find /usr/local -type d | grep -vxE '/usr/local(/etc|/games|/include|/lib(32|64)?|/man(/man[a-z0-9]+)?|/s?bin|/share(/color|/man(/man[a-z0-9]+)?|/misc)?|/src)?') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment