Hello, I bet someone has asked this before but I can't find the answer...
I am trying to keep only certain file types and delete the rest.
Code:
-rw-r--r-- 1 root root 0 2007-11-26 06:41 file_a.wmv
-rw-r--r-- 1 root root 0 2007-11-26 06:41 file_b.pdf
-rw-r--r-- 1 root root 0 2007-11-26 06:41 file_c.sh
-rw-r--r-- 1 root root 0 2007-11-26 06:41 file_d.mov
-rw-r--r-- 1 root root 0 2007-11-26 06:42 file_e.whatever
My goal is to delete b,c,e and keep wmv & mov
rm -f /path/to/folder/*^[wmv|mov]
Is there anything like this that will work?
My other alternative is to temporarily move all the wanted files out of that folder delete all then move them back. But I would imagine there is a simpler way.