Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- find . -maxdepth 1 -type f -regex "^.*\(png\|gif\)$" -exec rm {} \;
- find = Linux find command.
- . = current directory.
- -maxdepth 1 = Depth in folders beyond this one. 1 = /only/ this current folder.
- -type f = Regular file. -type d = directory.
- -regex "^.*\(png\|gif\)$" = "any file ending in PNG or GIF"
- -exec rm {} = Delete this file, represented as {}, by executing the Linux remove command.
- \; = Terminate the "-exec rm"
- "Search in this directory for any regular, non-directory file whose name ends with 'gif' or 'png' and delete it."
Advertisement
Add Comment
Please, Sign In to add comment