Skip to content

Instantly share code, notes, and snippets.

@foobit
Created May 17, 2013 19:51
Show Gist options
  • Save foobit/5601563 to your computer and use it in GitHub Desktop.
Save foobit/5601563 to your computer and use it in GitHub Desktop.
recurse folder find all by optional ext and return only file name
#!/bin/bash
if [-z "$1" ]; then
BASE_PATH=.
else
BASE_PATH=$1
fi
if [-z "$2" ]; then
FILTER_EXT=*
else
FILTER_EXT=$2
fi
find "$BASE_PATH" -type f -iname "$FILTER_EXT" -exec basename {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment