This aught to get you started.
It just list the files and size in the /home/images folder.
You will have to add some more stuff for deleting.
If you want to make a couple of empty files to help in testing,
the easiest way is use the command: >
For example:
>file.txt
Edit: you could test for more than one argument with this...
test $# == 1 || usage
Code:
#!/bin/bash
# Example: ./test /home/images
usage()
{
echo "Usage: $0 Directory_Name"
exit 1;
}
test -d "$1" || usage
for i in `ls $1/*` ; do
size=`stat -c %s $i`
if [ $size -lt 1 ]; then
echo "$i is $size ( This one is empty ) "
else
echo "$i is $size "
fi
done