Created
July 8, 2016 09:50
-
-
Save lnaia/bd3da112a552a9319ba89c37900c4c8b to your computer and use it in GitHub Desktop.
Create a report for all types of files within a given directory. Save full path to each file, and echo stat data to the screen.
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 | |
DIR=$1 | |
EXTENSIONS=`find $DIR -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -fu` | |
for ftype in $EXTENSIONS; do | |
echo -n "Searching for $ftype ... " | |
find $DIR -type f -iname "*.$ftype" -fprint $ftype.log | |
echo found `wc $ftype.log -l | cut -d' ' -f 1` files | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment