Roger Almengor
Roger Almengor

Reputation: 464

find . -type f -name "*.sw[klmnop]" -delete in Windows?

Is there an option to delete the swp files in Windows 10, using an equivalent to the command: find . -type f -name "*.sw[klmnop]" -delete in Linux, used for this purpose?

Upvotes: 0

Views: 101

Answers (1)

Dmitry
Dmitry

Reputation: 446

GUI method

Double commander has regex file search (ALT-F7), so you can find them by regex like ".*\.sw[klmnop]". When you have desired results, press "Feed to listbox" button, it will show all found files on the active panel. Then just select them with CTRL-A and delete permanently with SHIFT-F8.

CLI method

Also you can write batch file like in this answer. Sorry, I can't check if it works right now, but it should be like:

for /R %%f in (*.sw?) do del /f "%%f"

Please NOTE: it will delete all files with 3-letter extension starts with "sw", so be careful. I don't know regex file search on cmd, probably findstr could help, it accepts something like regex.

Upvotes: 2

Related Questions