Annotation of pkgsrc/sysutils/same/files/same.cat1, revision 1.1

1.1     ! rillig      1: SAME(1)                 NetBSD General Commands Manual                 SAME(1)
        !             2: 
        !             3: NNAAMMEE
        !             4:      ssaammee -- link identical files to save disk space
        !             5: 
        !             6: SSYYNNOOPPSSIISS
        !             7:      ssaammee [--HHVVccddhhnnssttuuvvzz]
        !             8: 
        !             9: DDEESSCCRRIIPPTTIIOONN
        !            10:      ssaammee takes a list of files (e.g. the output of find . -type f) on stdin.
        !            11:      Each of the files is compared against each of the others.  Whenever two
        !            12:      files are found that match exactly, the two files are linked (soft or
        !            13:      hard) together.
        !            14: 
        !            15:    GGooaall
        !            16:      The goal of this program is to conserve disk space when you have several
        !            17:      different trees of large projects on your disk.  By creating hardlinks or
        !            18:      softlinks between the files that are the same, you can save lots of disk
        !            19:      space.  For example, two different versions of the Linux kernel only dif-
        !            20:      fer in a small number of files.  By running this program you only need to
        !            21:      store the contents of those files once.  This is especially useful if you
        !            22:      have different versions of complete trees lying around.
        !            23: 
        !            24:    IImmpplleemmeennttaattiioonn
        !            25:      The filesize of every file is used as an indication of wether two files
        !            26:      can be the same. Whenever the filesizes match, the hashes of these two
        !            27:      files are compared. Whenever these match, the file contents are compared.
        !            28:      For every matching pair one of the two files is replaced by a hard link
        !            29:      to the other file.  With the -s option a softlink is used.
        !            30: 
        !            31:      To allow you to do this incrementally, the "rm" is done on the file with
        !            32:      the least links. This allows you to "merge" a new tree with several trees
        !            33:      that have already been processed. The new tree has link count 1, while
        !            34:      the old tree has a higher link count for those files that are likely can-
        !            35:      didates for linkage.
        !            36: 
        !            37:      The current implementation keeps the "first" incantation of a file, and
        !            38:      replaces further occurrances of the same file. This is significant when
        !            39:      using softlinks.
        !            40: 
        !            41:    OOppttiioonnss
        !            42:      --HH _n, ----hhaasshhssttaarrtt _n
        !            43:              Start at hash value _n instead of 0.
        !            44: 
        !            45:      --VV, ----vveerrssiioonn
        !            46:              Print the version of the program and exit.
        !            47: 
        !            48:      --cc _f_i_l_e, ----ccaacchhee _f_i_l_e
        !            49:              Keep a cache between runs in file _f_i_l_e.
        !            50: 
        !            51:      --dd, ----ddeebbuugg
        !            52:              Output some debug messages.
        !            53: 
        !            54:      --hh, ----hheellpp
        !            55:              Output this page and exit successfully.
        !            56: 
        !            57:      --nn, ----ddrryyrruunn
        !            58:              Only simulate.
        !            59: 
        !            60:      --ss, ----ssooffttlliinnkkss
        !            61:              Create soft links instead of hard links.
        !            62: 
        !            63:      --uu, ----uusseerr
        !            64:              Don't relink files owned by another user.
        !            65: 
        !            66:      --vv, ----vveerrbboossee
        !            67:              Output verbose messages.
        !            68: 
        !            69:      --zz, ----nnuullllffiilleess
        !            70:              Link empty files, too.  By default, only non-empty files are
        !            71:              linked.
        !            72: 
        !            73: EEXXIITT SSTTAATTUUSS
        !            74:      Zero on success, non-zero on failure.
        !            75: 
        !            76: EEXXAAMMPPLLEESS
        !            77:      find . -type f -print | same
        !            78: 
        !            79: SSEEEE AALLSSOO
        !            80:      find(1)
        !            81: 
        !            82: AAUUTTHHOORRSS
        !            83:      Roger E. Wolff <R.E.Wolff@BitWizard.nl>,
        !            84:      Geert Uytterhoeven <geert@linux-m68k.org>,
        !            85:      Roland Illig <roland.illig@gmx.de>.
        !            86: 
        !            87: CCAAVVEEAATTSS
        !            88:      ··   If your editor does not move the original aside before writing a new
        !            89:          copy, you will change the file in ALL incarnations when editing a
        !            90:          file.  Patch works just fine: it moves the original aside before cre-
        !            91:          ating a new copy.  I'm confident that I could learn Emacs to do it
        !            92:          this way too.  I'm too lazy to figure it out, so if you happen to
        !            93:          know an easy way how to do this, please Email me at
        !            94:          <R.E.Wolff@BitWizard.nl>.
        !            95: 
        !            96:      ··   There is a 1024 (BUFSIZE) character limit to pathnames when using
        !            97:          symlinks.
        !            98: 
        !            99: NetBSD 4.0                       July 14, 2004                      NetBSD 4.0

CVSweb <webmaster@jp.NetBSD.org>