Share icon

Usually we all use "rm" command to delete or remove the files and folder on linux, but if we want to delete the specific type of content/files then we can use "find" command to find and "delete" command to delete;

find . -name "*.zip" -type f -delete

or enter path of directory

find /path/to/dir -name "*.zip" -type f -delete

if you to get list of all items of specfic extension you can do like this before delete -

find . -name "*.zip" -type f 

or

ls -la *zip

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.