0

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?

Roger Almengor
  • 442
  • 5
  • 16

1 Answers1

2

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.

Dmitry
  • 436
  • 2
  • 7
  • Here is powershell method: https://stackoverflow.com/questions/23767489/how-can-one-delete-files-in-a-folder-matching-a-regular-expression-using-powersh – Dmitry Jul 22 '20 at 19:32