Deepak, is this homework?
Anyway, you can use the below logic:
For all directories under /home do the following (
for loop):
a. check the disk usage for each directory (using
du command)
b. if disk usage greater than 500M, then retrieve the email from /etc/passwd or whereever you have stored it (
IF Construct).
c. send email (using
mailx or sendmail).
Of course, you need to schedule the above script in cron so that it can be run periodically as per your requirement.
HTH,
Regards,
Praveen