How do I write a script that will list all files in a user-defined directory, as well as all sub-directories and order them by size? As well as give the user the option to delete any file that is a size of 0.
The script I have so far lists all files in current directory as well as sub-directories
for file in $( find . -type f ${dir} );
do
echo "$(basename "$file")"
done