How to do things
AI Noob vs. Pro

List biggest files
List newest files
Show subdir sizes
Search in files
Replace word in files
List dir differences
Send files in LAN

Free Open Source:

Swiss File Knife

a command line
multi function tool.

remove tabs
list dir sizes
find text
filter lines
find in path
collect text
instant ftp or
http server
file transfer
send text
patch text
patch binary
run own cmd
convert crlf
dup file find
md5 lists
fromto clip
hexdump
split files
list latest
compare dirs
save typing
trace http
echo colors
head & tail
dep. listing
find classes
speed shell
zip search
zip dir list

Depeche View
Source Research
First Steps

windows GUI
automation

command line
file encryption

free external tools,
zero install effort,
usb stick compliant:

zip and unzip
diff and merge
reformat xml
reformat source

cpp sources

log tracing
mem tracing
hexdump
using printf

articles

embedded
stat. c array
stat. java array
var. c array
var. java array
view all text
as you type
surf over text
find by click
quick copy
multi view
find nearby
fullscreen
bookmarks
find by path
expressions
location jump
skip accents
clip match
filter lines
edit text
highlight
load filter
hotkey list
receive text
send in C++
send in Java
smooth scroll
touch scroll
fly wxWidgets
fly over Qt
search Java

If you want to delete, for example, only .bak and .tmp files in a directory tree, within sub folders names tmp or save, then sfk delete helps with its very flexible file selection syntax. Free open source command line tool for Windows, Mac OS X, Linux and Raspberry Pi.
  • 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-64.exe sfk and chmod +x sfk then ./sfk
  • Linux: type mv sfk-linux-64.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
   -stoponerr    stop chain execution if delete is incomplete.
   -retry=n[:d]  if delete fails, retry up to n times waiting
                 d ms inbetween. default with deltree (not del)
                 is -retry=2:100

command return codes
   rc 0 : ok all deleted
   rc 5 : delete incomplete
   rc 9 : sfk rc with -stoponerr

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 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
   -stoponerr    stop chain execution if 
                 delete is incomplete.
   -retry=n[:d]  if delete fails, retry up 
                 to n times waiting d ms
                 inbetween. default with
                 deltree (not del) is
                 -retry=2:100

command return codes
   rc 0 : ok all deleted
   rc 5 : delete incomplete
   rc 9 : sfk rc with -stoponerr

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.

you are viewing this page in mobile portrait mode with a limited layout. turn your device right, use a desktop browser or buy the sfk e-book for improved reading.

 
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).

 

the Endless Image 🍣 Sushi