#!/bin/bash

if [ $# -ne 2 ]; then
	echo
	echo "USAGE : `basename $0` <path> <MB_size>"
	echo
	echo "        ./check_filesize.sh /jboss 100"
	echo
	exit 2
fi

SEARCH_PATH=${1}
MB_SIZE=${2}

cd ${SEARCH_PATH}

### Check File Size more than ${MB_SIZE}MB
file_list=`find . -size +${MB_SIZE}M -type f -print`

if [ $? -eq 0 ]; then

	for file in ${file_list}; do
	
		ls -l ${file}
	
	done
	
else
	echo 'The running of shell command is failed!!'
	exit
fi
