I am using Mountain Lion on a Mac. I want to delete all the files in a directory which do NOT end with .psd, .jpg, or .nef using Terminal. How would I do this? Thanks in advance!
If you use Bash, you can use extended globbing functions:
Then, to delete everything but
You can test it by using
Another way with
Test this command by removing the