Skip to content

Instantly share code, notes, and snippets.

@luveti
Created June 9, 2016 22:43
Show Gist options
  • Save luveti/cb396fdcc11c610310fd0e2ba87d3340 to your computer and use it in GitHub Desktop.
Save luveti/cb396fdcc11c610310fd0e2ba87d3340 to your computer and use it in GitHub Desktop.
Recursively find the smallest and largest file by extension, in a directory
#! /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