Alex Donald
  • Projects
  • Reference
  • About
  • Contact

Find and remove files

13 January, 2016
CLI • Bash
Source: http://www.cyberciti.biz/faq/linux-unix-how-to-find-and-remove-files/

Using the find command:

find dir-name criteria action

To remove multiple files, for example *.jpg, or *.sh, use:

find . -type f -name "*.jpg" -exec rm -rf {} \;

To remove matching directories as well as files, remove the -type f flag.

© 2022 Alex Donald · pgp.txt