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

Supersonic Text File Search - Free Download

Compare two directory trees and list different or added files on the Windows, Mac OS X, Linux and Raspberry Pi command line with freeware.
  • 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.
Imagine you have two directory trees:
  • fooproj in which you are working currently.
  • fooproj2 which is a copy of myproj made some days ago.
The fooproj directory contains source code text files, and you did many changes in the last days. But what changes?

list any added or different files between directories:

If you are currently within directory fooproj, type:

   sfk list -sincedir ..\fooproj2 .

which lists the current directory (fooproj) compared against the parallel fooproj2.
example result:

   [dif] BaseLib\Trace\include\Trace.hpp
   [add] docs\testcase01.txt
   [dif] FooBank\BarDriver\include\BarDriver.hpp
   [dif] FooBank\BarDriver\source\BarDriver.cpp
   [dif] FooBank\BarDriver\source\BarMug.cpp
   [dif] FooBank\DB\include\DBController.hpp
   [dif] FooBank\DB\source\DBController.cpp
   [tim] obj\BarDriver.obj
   [tim] obj\BarMug.obj
   [tim] obj\DBController.obj
   [dif] readme.txt
as you see, files with differences or which have been added are marked clearly.
files with just different time but still same content are marked with [tim].

list only added files:

   sfk list -sinceadd ..\fooproj2 .
example result:
   [add] docs\testcase01.txt
list files that have been removed from fooproj compared to fooproj2:

there is no "-sincerem option" doing this directly, but you can reverse the command like:

   sfk list -sinceadd . ..\fooproj2
which asks for files "added" to fooproj2 compared to the current dir. example result:
   [add] ..\fooproj2\Formats\01-native-tab-crlf.txt
   [add] ..\fooproj2\Formats\02-crlf.txt
   [add] ..\fooproj2\Formats\03-native-tab-lf.txt
   [add] ..\fooproj2\Formats\04-lf.txt
   [add] ..\fooproj2\Formats\05-split-text.txt
list only files where the content has changed:
   sfk list -sincediff ..\fooproj2 .
example result:
   [dif] BaseLib\Trace\include\Trace.hpp
   [dif] FooBank\BarDriver\include\BarDriver.hpp
   [dif] FooBank\BarDriver\source\BarDriver.cpp
   [dif] FooBank\BarDriver\source\BarMug.cpp
   [dif] FooBank\DB\include\DBController.hpp
   [dif] FooBank\DB\source\DBController.cpp
   [dif] readme.txt

run a self-defined command on different files:

   sfk run -sincediff ..\fooproj2 "diff $since $file" .
typed as above, the command will show:
   [simulating:]
   diff ..\fooproj2\BaseLib\Trace\include\Trace.hpp
          BaseLib\Trace\include\Trace.hpp
   diff ..\fooproj2\FooBank\BarDriver\include\BarDriver.hpp
          FooBank\BarDriver\include\BarDriver.hpp
   diff ..\fooproj2\FooBank\BarDriver\source\BarDriver.cpp
          FooBank\BarDriver\source\BarDriver.cpp
   diff ..\fooproj2\FooBank\BarDriver\source\BarMug.cpp 
          FooBank\BarDriver\source\BarMug.cpp
   diff ..\fooproj2\FooBank\DB\include\DBController.hpp 
          FooBank\DB\include\DBController.hpp
   diff ..\fooproj2\FooBank\DB\source\DBController.cpp 
          FooBank\DB\source\DBController.cpp
   diff ..\fooproj2\readme.txt readme.txt
   [add -yes to execute.]
which is just a simulated preview. if you think the command will do the right stuff, add -yes:

   sfk run -sincediff ..\fooproj2 "diff $since $file" . -yes
this example lists output created by an external command "diff", which is usually available on linux or if you download the free cygwin environment for windows. you may also use the free GUI tool WinMerge instead.
diff ..\fooproj2\FooBank\BarDriver\source\BarDriver.cpp 
      FooBank\BarDriver\source\BarDriver.cpp
1,7d0
< /*
<    this is a completely pointless text file
<    to easily demonstrate sfk functionality.
< */
< 
< #include "BaseLib/Trace/include/Trace.hpp"
< 
24,25d16
<       // dr. stresser: inserted super-important trace output here.
<       // do not remove, i need this.
28a20,24
> 
> void BarDriver::startup( )
> {
>    printf("starting\n");
> }
... rc 1
diff ..\fooproj2\FooBank\DB\source\DBController.cpp 
      FooBank\DB\source\DBController.cpp
1,4d0
< /*
<    this is a completely pointless text file
<    to easily demonstrate sfk functionality.
< */
6,7c2
< #include "FooBank/DB/include/DBController.hpp"
< #include "FooBank/BarDriver/include/BarDriver.hpp"
---
> // 1.2 bugfix: fixed DBController ctr crash
13,18c8,11
<    char *pblast = 0;
<    printf("yeee\n");
<    // dr. looney: this is superimportant fix.
<    // do not remove.
<    *pblast = '\0';
<    printf("- ho.\n");
---
>    // char *pblast = 0;
>    // printf("yeee\n");
>    // *pblast = '\0';
>    // printf("- ho.\n");
... rc 1
this way, we get an instant overview over all code changes (example output reduced here to two files). as we see,
  • text lines that have been removed are marked by <
  • text lines that have been inserted are marked by >
  • there are some strange lines like 24,25d16 which may be of use for further tools, but for us they're hard to read.
therefore let's filter the above to make it better readable.
type the following all in one line:
   sfk run -sincediff ..\fooproj2 "diff $since $file" . -yes -quiet
      +filter -+:file "-ls+<" "-ls+>" -high blue ":file *"
      -high red "<*" -high green ">*"
which filters out the hard-to-read stuff and highlights the content in different colors.
(to avoid typing the same long command ever again, create an sfk alias.)

example output:

:file FooBank\BarDriver\source\BarDriver.cpp
< /*
<    this is a completely pointless text file
<    to easily demonstrate sfk functionality.
< */
< 
< #include "BaseLib/Trace/include/Trace.hpp"
< 
<       // dr. stresser: inserted super-important trace output here.
<       // do not remove, i need this.
> 
> void BarDriver::startup( )
> {
>    printf("starting\n");
> }
:file FooBank\DB\source\DBController.cpp
< /*
<    this is a completely pointless text file
<    to easily demonstrate sfk functionality.
< */
< #include "FooBank/DB/include/DBController.hpp"
< #include "FooBank/BarDriver/include/BarDriver.hpp"
> // 1.2 bugfix: fixed DBController ctr crash
<    char *pblast = 0;
<    printf("yeee\n");
<    // dr. looney: this is superimportant fix.
<    // do not remove.
<    *pblast = '\0';
<    printf("- ho.\n");
>    // char *pblast = 0;
>    // printf("yeee\n");
>    // *pblast = '\0';
>    // printf("- ho.\n");
viewing the result in depeche view

last but least, if you add this to the above command:

   +view -noshl
then the result of the whole command sequence is shown instantly within depeche view, allowing you interactive realtime searches:

to make the +view command work, you have to download dview.exe first, and place it in your PATH. the parameter "-noshl" for "no syntax highlighting" is needed as the colors from syntax highlighting would mess up with the red and green that we use to highlight file differences.


 
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