Skip to content

clausecker/fdup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FDUP(1)                          User Commands                         FDUP(1)



NAME
       fdup - find duplicates


SYNOPSIS
       fdup [mode] [option...]  directory...


DESCRIPTION
       fdup traverses the supplied directories and finds files with equal con‐
       tents. fdup will not follow symbolic links it encounters.


OPTIONS
       This utility has four modes of operation. These are selected  with  the
       options  -B,  -H, -L and -S. If none of these options is provided, fdup
       behaves as if -S was selected. If more than one mode  of  operation  is
       provided, only the last mode that was passed counts.


       -B     Turn  files with equal contents into btrfs(8) lightweight copies
              of each other. A lightweight or COW copy shares  the  underlying
              disk  space  with the original file until it is altered, but has
              no other connections to the  original  file.  This  option  only
              works  on  Linux with files on btrfs file systems and implies -b
              d.


       -H     Turn each group of files with equal contents into  hardlinks  to
              one file. This implies -b dl.


       -L     List  groups  of  files  with equal contents, separated by blank
              files.


       -S     Similar to -H, turn each group of files with equal contents into
              symbolic  links  to one file. The file that is not turned into a
              symbolic link is arbitrarily chosen.


       -b specifier...
              Control file matching behavior. specifier is one or more of  the
              following  specifiers.  By  default, fdup considers all cases as
              duplicate that can be detected as distinct files with the speci‐
              fiers below.


              c      Files  with  different creation times are considered dis‐
                     tinct

              d      Files on different devices are considered distinct

              g      Files owned by different groups are considered distinct

              l      Hardlinks to the same file are considered distinct

              m      Files with different modification  times  are  considered
                     distinct

              p      Files with different permissions are considered distinct

              u      Files owned by different users are considered distinct


       -h     Print  a synopsis of fdup's command line options and then termi‐
              nate with an exit status of 0.


       -p     Preserve permissions, ownership, modification and access  times.
              If  -p  is  provided  and  fdup fails to correctly assign one of
              these attributes, no files are changed  and  fdup  aborts.  This
              differs  from  the behavior without -p, in that otherwise only a
              warning is printed and fdup  keeps  going,  possibly  clobbering
              attributes  of  the  file.  fdup attempts to preserve attributes
              regardless of -p. Please notice that -p has no effect when  used
              with  -L for obvious reasons. Only access and modification times
              are preserved when used with -S.


       -s n[,m]
              Restrict file size when looking for duplicates. If used  in  the
              form  -s n, fdup ignores all files that are less than n bytes in
              size.  If used in the form -s n,m, fdup ignores all  files  that
              are  less than n or more than m bytes in size. If you don't want
              to specify a lower  boundary,  use  -s  0,m.  By  default,  fdup
              behaves as if -s 0 has been given.

              Suffixes  K,  M,  G,  T,  P  and  E can be used to specify 1024,
              1024*1024, 1024*1024*1024,... bytes.

              This option can speed up operation if you are scanning  a  large
              amount  of  small files but don't care about duplicates in them,
              or if you don't want fdup to scan through very large files  that
              are known not to be duplicates.


       -v     Outputs  statistics  to  stderr(3) while processing files. These
              statistics can be useful as a progress indicator.


       -x     Stay on one file system. This applies to each supplied directory
              individually.


EXIT STATUS
       fdup  terminates  with  an  exit  status of 0 on success. If one of the
       operations fdup performs fails, its exit status is 1. If fdup does  not
       recognize one of the command line options it was called with, it termi‐
       nates with an exit status of 2.


BUGS
       When using the option -H, fdup is known to have problems when too  many
       files are considered equal.

       Please file bugs at <https://github.com/fuzxxl/fdup/issues>.


COPYRIGHT
       Copyright (c) 2013, Robert Clausecker
       All rights reserved.

       Redistribution and use in source and binary forms, with or without mod‐
       ification, are permitted provided that  the  following  conditions  are
       met:


       1.     Redistributions  of  source code must retain the above copyright
              notice, this list of conditions and the following disclaimer.


       2.     Redistributions in binary form must reproduce  the  above  copy‐
              right  notice,  this  list  of conditions and the following dis‐
              claimer in the documentation  and/or  other  materials  provided
              with the distribution.

       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS
       IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT  NOT  LIMITED
       TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
       ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER  OR
       CONTRIBUTORS  BE  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
       EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  BUT  NOT  LIMITED  TO,
       PROCUREMENT  OF  SUBSTITUTE  GOODS  OR  SERVICES; LOSS OF USE, DATA, OR
       PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY  OF
       LIABILITY,  WHETHER  IN  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
       NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  OF  THE  USE  OF  THIS
       SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


AUTHOR
       Written by Robert Clausecker <fuzxxl@gmail.com>.


SEE ALSO
       find(1)



Robert Clausecker                 2013-08-29                           FDUP(1)