Annotation of pkgsrc/sysutils/same/files/same.1, revision 1.1
1.1 ! minskim 1: .TH same 1
! 2:
! 3: .SH NAME
! 4: same \- find identical files and link them to save disk space.
! 5:
! 6: .SH SYNOPSIS
! 7:
! 8: \fBsame\fR [-d | --debug] [-hs \fIn\fR | --hashstart \fIn\fR]
! 9: [-n | --dryrun] [-s] [-t | --timings] [-v | --verbose]
! 10: [-z --nullfiles]
! 11:
! 12: .SH OPTIONS
! 13:
! 14: .TP
! 15: \fB\-d\fR, \fB\-\-debug\fR
! 16: Switch on debugging messages from the program.
! 17:
! 18: .TP
! 19: \fB\-hs\fR \fIn\fR, \fB--hashstart\fR \fIn\fR
! 20: Set the start value of the hash function.
! 21:
! 22: .TP
! 23: \fB\-n\fR, \fB\-\-dryrun\fR
! 24: Do not modify any file on the disk.
! 25:
! 26: .TP
! 27: \fB\-s\fR
! 28: Create symbolic links instead of hard links.
! 29:
! 30: .TP
! 31: \fB\-t\fR, \fB\-\-timings\fR
! 32: At the end of the program, output the time needed.
! 33:
! 34: .TP
! 35: \fB\-v\fR, \fB\-\-verbose\fR
! 36: Output some messages what is done.
! 37:
! 38: .TP
! 39: \fB\-z\fR, \fB\-\-nullfiles\fR
! 40: Even create links for empty files. Normally these files are ignored.
! 41:
! 42:
! 43: .SH INTRODUCTION
! 44:
! 45: This program takes a list of files (e.g. the output of \fBfind . -type f\fR)
! 46: on stdin. Each of the files is compared against each of the
! 47: others. Whenever two files are found that match exactly, the two files
! 48: are linked (soft or hard) together.
! 49:
! 50:
! 51: .SH GOAL
! 52:
! 53: The goal of this program is to conserve disk space when you have
! 54: several different trees of large project on your disk. By creating
! 55: hardlinks or softlinks between the files that are the same, you can
! 56: save lots of disk space. For example, two different versions of the
! 57: Linux kernel only differ in a small number of files. By running this
! 58: program you only need to store the contents of those files once.
! 59: This is especially useful if you have different versions of complete
! 60: trees lying around.
! 61:
! 62: .SH IMPLEMENTATION
! 63:
! 64: The filesize of every file is used as an indication of wether two
! 65: files can be the same. Whenever the filesizes match, the hashes of
! 66: these two files are compared. Whenever these match, the file
! 67: contents are compared. For every matching pair one of the two
! 68: files is replaced by a hard link to the other file.
! 69: With the \fB-s\fR option a softlink is used.
! 70:
! 71: To allow you to do this incrementally, the "rm" is done on the file
! 72: with the least links. This allows you to "merge" a new tree with
! 73: several trees that have already been processed. The new tree has
! 74: link count 1, while the old tree has a higher link count for those
! 75: files that are likely candidates for linkage.
! 76:
! 77: The current implementation keeps the "first" incantation of a file,
! 78: and replaces further occurrances of the same file. This is
! 79: significant when using softlinks.
! 80:
! 81: .SH EXAMPLE
! 82:
! 83: .TP
! 84: \fBfind . -type f | same\fR
! 85:
! 86: This links all files together under the current directory that are
! 87: the same.
! 88:
! 89: .SH BUGS
! 90:
! 91: .IP \(bu
! 92: Make sure that you have all the permissions required for
! 93: execution of the commands.
! 94:
! 95: .IP \(bu
! 96: RCS probably allows you to do similar things.
! 97:
! 98: .IP \(bu
! 99: If your editor does not move the original aside before writing a
! 100: new copy, you will change the file in ALL incarnations when
! 101: editing a file. Patch works just fine: it moves the original
! 102: aside before creating a new copy. I'm confident that I could
! 103: learn Emacs to do it this way too. I'm too lazy to figure it out,
! 104: so if you happen to know an easy way how to do this, please Email
! 105: me at R.E.Wolff@BitWizard.nl
! 106:
! 107: .IP \(bu
! 108: There is a 1024 character limit to pathnames when using symlinks.
! 109:
! 110: .SH AUTHOR
! 111:
! 112: This manpage was written by Roland Illig <roland.illig@gmx.de> for the
! 113: pkgsrc distribution. Some sections are taken from the source code of
! 114: `same'.
CVSweb <webmaster@jp.NetBSD.org>