1 SAME(1) NetBSD General Commands Manual SAME(1)
4 s
\bsa
\bam
\bme
\be -- link identical files to save disk space
6 S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
7 s
\bsa
\bam
\bme
\be [-
\b-H
\bHV
\bVc
\bcd
\bdh
\bhn
\bns
\bst
\btu
\buv
\bvz
\bz]
9 D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
10 s
\bsa
\bam
\bme
\be 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
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.
24 I
\bIm
\bmp
\bpl
\ble
\bem
\bme
\ben
\bnt
\bta
\bat
\bti
\bio
\bon
\bn
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.
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-
37 The current implementation keeps the "first" incantation of a file, and
38 replaces further occurrances of the same file. This is significant when
41 O
\bOp
\bpt
\bti
\bio
\bon
\bns
\bs
42 -
\b-H
\bH _
\bn, -
\b--
\b-h
\bha
\bas
\bsh
\bhs
\bst
\bta
\bar
\brt
\bt _
\bn
43 Start at hash value _
\bn instead of 0.
45 -
\b-V
\bV, -
\b--
\b-v
\bve
\ber
\brs
\bsi
\bio
\bon
\bn
46 Print the version of the program and exit.
48 -
\b-c
\bc _
\bf_
\bi_
\bl_
\be, -
\b--
\b-c
\bca
\bac
\bch
\bhe
\be _
\bf_
\bi_
\bl_
\be
49 Keep a cache between runs in file _
\bf_
\bi_
\bl_
\be.
51 -
\b-d
\bd, -
\b--
\b-d
\bde
\beb
\bbu
\bug
\bg
52 Output some debug messages.
54 -
\b-h
\bh, -
\b--
\b-h
\bhe
\bel
\blp
\bp
55 Output this page and exit successfully.
57 -
\b-n
\bn, -
\b--
\b-d
\bdr
\bry
\byr
\bru
\bun
\bn
60 -
\b-s
\bs, -
\b--
\b-s
\bso
\bof
\bft
\btl
\bli
\bin
\bnk
\bks
\bs
61 Create soft links instead of hard links.
63 -
\b-u
\bu, -
\b--
\b-u
\bus
\bse
\ber
\br
64 Don't relink files owned by another user.
66 -
\b-v
\bv, -
\b--
\b-v
\bve
\ber
\brb
\bbo
\bos
\bse
\be
67 Output verbose messages.
69 -
\b-z
\bz, -
\b--
\b-n
\bnu
\bul
\bll
\blf
\bfi
\bil
\ble
\bes
\bs
70 Link empty files, too. By default, only non-empty files are
73 E
\bEX
\bXI
\bIT
\bT S
\bST
\bTA
\bAT
\bTU
\bUS
\bS
74 Zero on success, non-zero on failure.
76 E
\bEX
\bXA
\bAM
\bMP
\bPL
\bLE
\bES
\bS
77 find . -type f -print | same
79 S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
82 A
\bAU
\bUT
\bTH
\bHO
\bOR
\bRS
\bS
83 Roger E. Wolff <R.E.Wolff@BitWizard.nl>,
84 Geert Uytterhoeven <geert@linux-m68k.org>,
85 Roland Illig <roland.illig@gmx.de>.
87 C
\bCA
\bAV
\bVE
\bEA
\bAT
\bTS
\bS
88 ·
\b· 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>.
96 ·
\b· There is a 1024 (BUFSIZE) character limit to pathnames when using
99 NetBSD 4.0 July 14, 2004 NetBSD 4.0