find-my-trash.sh 847 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # This software is licensed unter the GPLv3.
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # See http://www.gnu.org/licenses/ fore more information.
  15. # Copyright (C) 2020 by this-is-kate (https://notabug.org/this-is-kate)
  16. cd /
  17. SEARCH=($(find $1 -type d -name "*trashfinder*"))
  18. sss=( "${SEARCH[@]}" )
  19. for s in ${sss[@]}
  20. do
  21. $( rm -rf $(echo "${s}/*") )
  22. done
  23. exit 0