Created
June 9, 2016 22:43
-
-
Save luveti/cb396fdcc11c610310fd0e2ba87d3340 to your computer and use it in GitHub Desktop.
Recursively find the smallest and largest file by extension, in a directory
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 | |
find "$1" -type f -name "*.$2" -printf "%s\t%p\n" | sort -n -r | tail -1; | |
find "$1" -type f -name "*.$2" -printf "%s\t%p\n" | sort -n | tail -1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment