I would like to count the number of files in single folder and, if the number of files exceeds an certain number (eg. 5000), an email should be sent.
The commands are like this, but I'd like to have it in one single line (using later for cron job):
count=$(find /dir1/dir2/dir3 -name "*.jpg" | wc -l)
if [ $count -gt 5000 ]
then
<command to send email>
else
<do nothing>
fi