Search and Delete Python Script

This Python script is designed to search and delete files and folders in the root directory of a device. The user can input the minimum size a file or folder should be in gigabytes and the age of the file or folder in days. The script will then display all the paths of the files and folders it has found that match the input criteria, as well as their age and size. The user will then have the option to delete all the displayed files and folders. If a file or folder cannot be found, or if it cannot be deleted, the script will display a message indicating the reason why.

Running the script

  1. Make sure you have Python installed on your device. Check what version of python you have by enterring python3 in your terminal
  2. Download the script file to your device.
  3. Navigate to the directory where the script file is located in your terminal.
  4. Run the script by typing python3 declutter.py.
  5. Follow the prompts in the terminal to input the minimum size and age of the files and folders you want to search for.
  6. Follow the prompts to delete the found files and folders, or terminate the script.

Tips

  • Be careful when using this script, as deleted files and folders cannot be recovered.
  • Double check the input criteria before running the script to make sure you are searching for the correct files and folders.
  • If you encounter any errors or issues when running the script, make sure you have the correct dependencies installed and that you are using a compatible version of Python.