exf command line usage

Usage: exf [OPTIONS] [HASH METHOD(s)] [FILE(s)]

  -r         Recurse subdirectories
  -d PATH    Set working directory
  -otf FILE  Output to file instead of console (deletes file if exists)
  -c FILE    Use digest file to test files, report errors only
  -cv FILE   Use digest file to test files, verbose (report every file)
  -mt N      Set maximum hash threads to N

  -omd5      Output style: md5sum (default)
  -ofcmd5    Output style: FILECHECKMD5
  -osfv      Output style: Simple File Verification (defaults to -crc32 hash)
  -osha1     Output style: sha1sum (defaults to -sha1 hash)

  -fp        Output includes full paths.

  -md5sum    Same as <exf -r -otf exactfile.md5 -omd5 -md5 *.*>

  -license   Output exf EULA.

  Hash methods: (defaults to -md5, except for -osfv, -osha1)


  Maximum hash threads: exf defaults to 1 for written CD media. Otherwise, the
  number of processor cores is used, up to 16. exf will never use more than 16
  hash threads even if more is specified with -mt.

  When -c is specified, the working directory is set to the location of the
  digest file unless -d is specified.

  Using -otf will erase the output file specified if it already exists. Using
  this option ensures that the digest file being created will not be a part
  of the digest itself.

  -md5sum creates a digest file named "exactfile.md5" in the working directory,
  using the md5 hash method, with recursive subdirectory scanning of all files.
  Only -mt and -d are valid options when -md5sum is used.

  You can redirect console output to a file by appending > filename.txt to the
  command line. Note that if you redirect output to a file in the scanning
  path when creating a digest, and the file name matches the scanning file
  mask, an non-fatal error will be included in the digest file because exf
  will attempt to hash the output file while it is still being written.
  To avoid this, use the -otf FILE option.

  For more information on exf output formats see www.ExactFile.com.


  exf -c sums.md5 -d C:\temp
    Tests files in digest file "sums.md5" (loads sums.md5 from current
    directory); assumes the files listed in the digest are in C:\temp.

  exf -c sums.md5
    Tests files in digest file "sums.md5"; assumes both the digest file and the
    files listed in the digest file are in the current directory.

  exf -c C:\temp\sums.md5
    Tests files in digest file "C:\temp\sums.md5"; assumes the files listed in
    the digest file are in the same folder as the digest file (C:\temp)

  exf -md5sum
    Creates a digest file in the current directory named "exactfile.md5" using
    the md5 hash method with recursive subdirectory scanning of all files of
    the current directory.

  exf -md5sum -d C:\temp
    Like above, but creates digest file "C:\temp\exactfile.md5" and scans files
    and subdirectories C:\temp

  exf -r -otf tempsums.md5 -d C:\temp *.txt *.exe
    Creates digest file "tempsums.md5" in C:\temp, scanning all of the files
    matching "*.txt" and "*.exe" in C:\temp and all subdirectories.

  exf -r -otf "C:\sums folder\tempsums.md5" -d C:\temp *.txt *.exe
    Same as above, but writes digest file to "C:\sums folder" instead.

  exf -crc32 -sha1 -md5 -gost myfile.zip
    Output CRC32, SHA1, MD5, and GOST hashes for myfile.zip in the current
    directory. Uses md5sum output format.

11 thoughts on “exf command line usage

  1. rudis

    Does the exf send eny error codes?

    With this command i liked it to print “0” if all is ok?
    for /F “delims=” %i IN (‘dir /s /b **.sfv’) DO @exf -c “%~fi” | @echo %errorlevel%

    Goal is to move complete/checked folders to another directory…
    Great tool by the way, using this and md5deep/hashdeep

  2. rudis

    Found the basic part my self! 🙂

    (for /F “usebackq delims=” %i IN (`dir /s /b *Arome*.sfv`) DO @(@exf -c %~fi | find /I “No errors”) && @echo %~fi) | FIND /I /V “No error”
    This command pick out all sfv-files that are ok!
    Put that in a FOR loop and you can easy move the files…

  3. David Buchan

    I’ve created a Windows Powershell script that recurses it’s way down the directory tree creating a hash file for each individual directory. It only creates a file if there is one missing, the hash file is not the most recent in the directory, the directory has been modified or if the count of items in the hash file does not match the number of files in the directory.

    Once I’ve done some more testing I’ll post the code publically.

    In testing I’ve found that the command line and app finish the file differently. The app finishes with the number of files hashed, whereas the commandline doesn’t. If the command line had the number of files, checking would be better.

  4. Mike Smith

    Great tool with MD5 for validating backup files on an exrernal HD. Many thanks. BUT I only need CRC32 and cannot generate the relevant SFV checksum file. I’ve tried nearly all combinations of your options — but in vain. I simply have a folder (say, C:\My Folder) for which I want to generate a CRC32 checksum file recursively stepping through all subdirectories, then, after copying the folder with the newly created checksum to the external HD folder (say, H:\My Folder), to check the copied checksum against the copied folder files. Your example works well for -md5sum but I can’t break it down into its component parts in a way that works and that I can then ‘convert’ to CRC. Can you please help?

  5. Richard

    Really handy piece of software, works pretty much exactly as I want, esp. with the test applet to give to the end-user without having to have him install / understand / configure the prog.

    A suggestion – files may get added that are not in the check, if, say on a network share
    An option to report additional unchecked files would be handy, or just a warning “additional unchecked files found”.

  6. ThatGuy

    Thank you for this great application, I did find this issue.

    BUG: Any other hash method other than -md5 has this output error. – “?HASH”
    Note: -osha1 does not have this issue but -sha1 does.

    Input:”exf -sha1 -r -d PATH *.*”
    Output:”HASH ?SHA1*file.txt”

    Hashes that have the same issue.

    If anyone has a work-around post it.

  7. Brandon Post author

    That is not a bug. That is how the hash method is stored in the file if you use something other than MD5.

  8. zargonog

    Great utility, much faster than other utilities I’ve seen when dealing with lots of large files.

    Only question is, is there a way to force it to use MD5 when checking a digest file?

    For some reason, a .md5 file formatted like this works fine:
    70173480906f1610780b852f95c57bf7 *reel_2\uhd\blah.tiff

    but when you don’t have the * in the path, it tries to validate against SHA-1 instead:
    70173480906f1610780b852f95c57bf7 reel_2\uhd\blah.tiff

  9. Dani


    I’m using the command line tool to create md5 of folders one by one, since I often modify the folders and I don’t want to create again a file of all the folders due to it takes long time.

    My plan was using cmd interpreter of Windows, but unfortunately I’m working in external hard disk and suddenly the cmd prompts that it cannot find the current path.

    I was using the following loop:

    set DIR_LIST=(dir1 dir2 dir3)
    for %I in %DIR_LIST% do cd %I; exf.exe -r -otf checksums.md5 -omd5 -md5 *.*;cd ..

    Then I get the error message.

    For that, I decided to use cygwin, since .exe files can be executed with cygwin also. Unfortunately, after writing the following command:

    directories=(dir1 dir2 dir3)
    for dir in ${directories[*]}; do echo “Processing directory $dir”; cd $dir; exf.exe -r -otf checksums.md5 -omd5 -md5 *.* ; cd ..; echo “”;done

    I got only the files that are in the root of the folder. I don’t get the checksum.md5 of all the files in all the subfolders, like if the “-r” option was ignored.

    Is anyone having experience with cygwin and exf.exe?

    Thanks a lot in advance and best regards.


    PS: amazing tool!!

  10. Garland Curry

    I am trying to use digest file to test files, verbose (report every file so I am using the -cv switch which works, but in that output file I am trying to display the SHA1 hash with each file and not just the regular pass/fail output that is displayed with the test file output. I tried to use -sha1 and -osha switches but it still does not work. Is this output possible?

Comments are closed.