Swiss File Knife
a command line
free external tools,
- download the free Swiss File Knife Base from Sourceforge. - open the Windows CMD command line, Mac OS X Terminal or Linux shell. - OS X : type mv sfk-mac-i686.exe sfk and chmod +x sfk then ./sfk - Linux: type mv sfk-linux.exe sfk and chmod +x sfk then ./sfk OS X and Linux syntax may differ, check the help within the tool.
sfk delete dir ext1 [ext2 ...] [-yes] sfk deltree targetdir [-yes] sfk del -dir dir1 dir2 -file .ext1 delete files or dirs, even if they're write protected. deltree or rmtree deletes a directory tree with all contents. options -yes really delete the files. without option -yes, del only lists the files that would be deleted. -withdirs if you supply a file mask other than "*", or -wdir and file deletion leads to an empty directory, then the directory is removed as well. if you supply no file mask (or "*"), then every empty directory is always deleted. this option cannot be used with chaining, as chaining passes only filenames, but no processed directory names. -hidden include hidden and system files. this option is default when using deltree. -quiet print nothing -stat show statistics even with -quiet lazy confirmation on command chaining if you selected files in a command chain, then want to add +del you may type "+del." (with a dot) or "+del!" (windows only) instead of "+del -yes" to actually delete the files. web reference http://stahlworks.com/sfk-del examples sfk del -withdirs src .bak deletes .bak files within src and all subdirs. if a directory contained only .bak files, it is deleted as well. sfk del -yes -withdirs -hidden tmp delete tmp with all files, including hidden files. sfk deltree. tmp the same as above, with "." as a short for -yes. sfk list -dir src -file foo*.hpp +del first list target files, then add +del sfk fromclip +del take a list of filenames from clipboard and delete them. see "sfk help shell" on how to configure your windows command prompt, to allow easy copying of filename lists. example with output: I plan to delete all .bak files in directory tree "src1", and all .tmp files in directory tree "src2": sfk del -dir src1 -file .bak -dir src2 -file .tmp [simulating:] DEL : src1\FooBank\BarDriver\include\BarGlass.bak DEL : src1\FooBank\BarDriver\include\BarMug.bak DEL : src1\FooBank\DB\include\DBController.bak DEL : src1\FooBank\GUI\include\FooGUI.bak DEL : src2\FooBank\BarDriver\include\BarGlass.tmp DEL : src2\FooBank\BarDriver\include\BarMug.tmp DEL : src2\FooBank\DB\include\DBController.tmp DEL : src2\FooBank\GUI\include\FooGUI.tmp 10 files would be deleted. [say -yes, -del. or -del! to execute.] But I see: oops, I want to keep DBController.bak as it may be needed later... same applies for FooGUI.tmp. No problem - above is just a simulation, so nothing happened yet. I adapt the command to: sfk del -dir src1 -file .bak !DBCon -dir src2 -file .tmp !FooGUI [simulating:] DEL : src1\FooBank\BarDriver\include\BarGlass.bak DEL : src1\FooBank\BarDriver\include\BarMug.bak DEL : src1\FooBank\GUI\include\FooGUI.bak DEL : src2\FooBank\BarDriver\include\BarGlass.tmp DEL : src2\FooBank\BarDriver\include\BarMug.tmp DEL : src2\FooBank\DB\include\DBController.tmp 8 files would be deleted. [say -yes, -del. or -del! to execute.] The result looks OK, so I add "-yes" to really delete the files.
sfk is a free open-source tool, running instantly without installation efforts. no DLL's,
no registry changes - just get sfk.exe from the zip package and use it (binaries for
windows, linux and mac are included).
read more about all sfk functions here.