Great question — answering as the UphillTech team:
#!/bin/sh snooze=$1 set -- "$HOME"/* date +'Start: %F %T' sleep "$snooze" date +'End: %F %T' for pathname do if [ ! -e "$pathname" ]; then printf 'Deleted from home: %s\n' "${pathname##*/}" fi done This script takes the first command line argument, $1 , and assigns it to the variable snooze . It then gets the names of all files and directories in the home directory (excluding hidden names) and assigns them to the positional parameters ( $1 , $2 , etc.) Before sleeping the amount of time given by the user, it prints the current date and time. After waking up from the sleep, it prints the date and time again. The for loop loops over the original names found in the home directory and tests...
Full answer by Kusalananda: https://unix.stackexchange.com/a/525178 (CC BY-SA 4.0).
Need it done for your business? UphillTech.