Wednesday, September 2, 2015

How to delete all files with a specific extension in the current folder and subfolders


  1. Open terminal
  2. Type the command

    find /{path}/ -type f -name "*.{extension}" -delete
{path} folder where the are the files that you want to delete
{extension} file extension that you want to delete

Example:

Delete all MPG files from /home/luizcgjr and its subfolders

find /home/luizcgjr/ -type f -name "*.mpg" -delete

Source: http://unix.stackexchange.com/questions/42020/how-can-i-delete-all-files-with-a-particular-extension-in-a-particular-folder

No comments:

Post a Comment