Questions about using the command-line interface (CLI).

learn more… | top users | synonyms (5)

29
votes
8answers
3k views
+100

Delete all files except files with the extension pdf in a directory

I have a directory that contains the following: x.pdf y.zip z.mp3 a.pdf I want to delete all files apart from x.pdf and a.pdf. How do I do this from the terminal? There are no subdirectories so no ...