Created
August 14, 2022 12:07
-
-
Save moekhalil/ed388a0f7b7eb2715f600b38cdf41553 to your computer and use it in GitHub Desktop.
Nested Folder File Counter
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 | |
# Usually sitting in my .bash_alias file | |
folderFileCounter() { | |
echo -e Directory: .\\\nFiles: `(/usr/bin/find . -maxdepth 1 -type f) | wc -l` | |
/usr/bin/find . -mindepth 1 -maxdepth 1 -type d -exec sh -c "echo Directory: {}\\\nFiles: \`/usr/bin/find {} -type f | wc -l\`\\\n" \; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment