The script:
#!/bin/sh
echo “This is the directory you are going to delete: $PWD? If you type ‘Yes’ you’ll see a list of the files for confirmation. Type ‘q’ to quit the list.”
read klk
if [[ $klk == “yes” || $klk == “Yes” || $klk == “YES” ]]; then
find * -xdev -type f|less
echo “Ok, the files on the list will be gone, is that OK? ‘Yes’ to proceed.”
read klk2
if [[ $klk2 == “yes” || $klk2 == “Yes” || $klk2 == “YES” ]]; then
find * -xdev -type f -exec rm -rf ..?* .[!.]* {} +
echo “Ok, files were deleted from $PWD.”
else
echo “Better safe than sorry. Bye.”
fi
else
echo “Well, see you later!”
fi