| 1 |
.ds Rv 5.10.1 |
| 2 |
.ds Dt 2025-12-02 |
| 3 |
.ds i \&\s-1ISO\s0 |
| 4 |
.ds r \&\s-1RCS\s0 |
| 5 |
.ds u \&\s-1UTC\s0 |
| 6 |
.ds o \*r file |
| 7 |
.if n .ds - \%-- |
| 8 |
.if t .ds - \(em |
| 9 |
.TH RCSCLEAN 1 "\*(Dt" "GNU RCS \*(Rv" |
| 10 |
.SH NAME |
| 11 |
rcsclean \- clean up working files |
| 12 |
.SH SYNOPSIS |
| 13 |
.B rcsclean |
| 14 |
.RI [ options "] [ " file " .\|.\|. ]" |
| 15 |
.SH DESCRIPTION |
| 16 |
.B rcsclean |
| 17 |
removes files that are not being worked on. |
| 18 |
.B "rcsclean \-u" |
| 19 |
also unlocks and removes files that are being worked on |
| 20 |
but have not changed. |
| 21 |
.PP |
| 22 |
For each |
| 23 |
.I file |
| 24 |
given, |
| 25 |
.B rcsclean |
| 26 |
compares the working file and a revision in the corresponding |
| 27 |
\*o. If it finds a difference, it does nothing. |
| 28 |
Otherwise, it first unlocks the revision if the |
| 29 |
.B \-u |
| 30 |
option is given, |
| 31 |
and then removes the working file |
| 32 |
unless the working file is writable and the revision is locked. |
| 33 |
It logs its actions by outputting the corresponding |
| 34 |
.B "rcs \-u" |
| 35 |
and |
| 36 |
.B "rm \-f" |
| 37 |
commands on the standard output. |
| 38 |
.PP |
| 39 |
Files are paired as explained in |
| 40 |
.BR ci (1). |
| 41 |
If no |
| 42 |
.I file |
| 43 |
is given, all working files in the current directory are cleaned. |
| 44 |
Filenames matching an \*r suffix denote \*os; |
| 45 |
all others denote working files. |
| 46 |
.PP |
| 47 |
The number of the revision to which the working file is compared |
| 48 |
may be attached to any of the options |
| 49 |
.BR \-n , |
| 50 |
.BR \-q , |
| 51 |
.BR \-r , |
| 52 |
or |
| 53 |
.BR \-u . |
| 54 |
If no revision number is specified, then if the |
| 55 |
.B \-u |
| 56 |
option is given and the caller has one revision locked, |
| 57 |
.B rcsclean |
| 58 |
uses that revision; otherwise |
| 59 |
.B rcsclean |
| 60 |
uses the latest revision on the default branch, normally the root. |
| 61 |
.PP |
| 62 |
.B rcsclean |
| 63 |
is useful for |
| 64 |
.B clean |
| 65 |
targets in makefiles. |
| 66 |
See also |
| 67 |
.BR rcsdiff (1), |
| 68 |
which prints out the differences, |
| 69 |
and |
| 70 |
.BR ci (1), |
| 71 |
which |
| 72 |
normally reverts to the previous revision |
| 73 |
if a file was not changed. |
| 74 |
.SH OPTIONS |
| 75 |
.TP |
| 76 |
.BI \-k subst |
| 77 |
Use |
| 78 |
.I subst |
| 79 |
style keyword substitution when retrieving the revision for comparison. |
| 80 |
See |
| 81 |
.BR co (1) |
| 82 |
for details. |
| 83 |
.TP |
| 84 |
.BR \-n [\f2rev\fP] |
| 85 |
Do not actually remove any files or unlock any revisions. |
| 86 |
Using this option will tell you what |
| 87 |
.B rcsclean |
| 88 |
would do without actually doing it. |
| 89 |
.TP |
| 90 |
.BR \-q [\f2rev\fP] |
| 91 |
Do not log the actions taken on standard output. |
| 92 |
.TP |
| 93 |
.BR \-r [\f2rev\fP] |
| 94 |
This option has no effect other than specifying the revision for comparison. |
| 95 |
.TP |
| 96 |
.B \-T |
| 97 |
Preserve the modification time on the \*o |
| 98 |
even if the \*o changes because a lock is removed. |
| 99 |
This option can suppress extensive recompilation caused by a |
| 100 |
.BR make (1) |
| 101 |
dependency of some other copy of the working file on the \*o. |
| 102 |
Use this option with care; it can suppress recompilation even when it is needed, |
| 103 |
i.e. when the lock removal |
| 104 |
would mean a change to keyword strings in the other working file. |
| 105 |
.TP |
| 106 |
.BR \-u [\f2rev\fP] |
| 107 |
Unlock the revision if it is locked and no difference is found. |
| 108 |
.TP |
| 109 |
.BI \-V |
| 110 |
Print \*r's version number. |
| 111 |
.TP |
| 112 |
.BI \-V n |
| 113 |
Emulate \*r version |
| 114 |
.IR n . |
| 115 |
See |
| 116 |
.BR co (1) |
| 117 |
for details. |
| 118 |
.TP |
| 119 |
.BI \-x "suffixes" |
| 120 |
Use |
| 121 |
.I suffixes |
| 122 |
to characterize \*os. |
| 123 |
See |
| 124 |
.BR ci (1) |
| 125 |
for details. |
| 126 |
.TP |
| 127 |
.BI \-z zone |
| 128 |
Use |
| 129 |
.I zone |
| 130 |
as the time zone for keyword substitution; |
| 131 |
see |
| 132 |
.BR co (1) |
| 133 |
for details. |
| 134 |
.SH EXAMPLES |
| 135 |
.LP |
| 136 |
.RS |
| 137 |
.ft 3 |
| 138 |
rcsclean *.c *.h |
| 139 |
.ft |
| 140 |
.RE |
| 141 |
.LP |
| 142 |
removes all working files ending in |
| 143 |
.B .c |
| 144 |
or |
| 145 |
.B .h |
| 146 |
that were not changed |
| 147 |
since their checkout. |
| 148 |
.LP |
| 149 |
.RS |
| 150 |
.ft 3 |
| 151 |
rcsclean |
| 152 |
.ft |
| 153 |
.RE |
| 154 |
.LP |
| 155 |
removes all working files in the current directory |
| 156 |
that were not changed since their checkout. |
| 157 |
.SH FILES |
| 158 |
.B rcsclean |
| 159 |
accesses files much as |
| 160 |
.BR ci (1) |
| 161 |
does. |
| 162 |
.SH ENVIRONMENT |
| 163 |
.TP |
| 164 |
.B \s-1RCSINIT\s0 |
| 165 |
Options prepended to the argument list, separated by spaces. |
| 166 |
A backslash escapes spaces within an option. |
| 167 |
The |
| 168 |
.B \s-1RCSINIT\s0 |
| 169 |
options are prepended to the argument lists of most \*r commands. |
| 170 |
Useful |
| 171 |
.B \s-1RCSINIT\s0 |
| 172 |
options include |
| 173 |
.BR \-q , |
| 174 |
.BR \-V , |
| 175 |
.BR \-x , |
| 176 |
and |
| 177 |
.BR \-z . |
| 178 |
.TP |
| 179 |
.B \s-1RCS_MEM_LIMIT\s0 |
| 180 |
Normally, for speed, commands either memory map or copy into memory |
| 181 |
the \*o if its size is less than the |
| 182 |
.IR memory-limit , |
| 183 |
currently defaulting to ``unlimited''. |
| 184 |
Otherwise (or if the initially-tried speedy ways fail), |
| 185 |
the commands fall back to using |
| 186 |
standard i/o routines. |
| 187 |
You can adjust the memory limit by setting |
| 188 |
.B \s-1RCS_MEM_LIMIT\s0 |
| 189 |
to a numeric value |
| 190 |
.IR lim |
| 191 |
(measured in kilobytes). |
| 192 |
An empty value is silently ignored. |
| 193 |
As a side effect, specifying |
| 194 |
.B \s-1RCS_MEM_LIMIT\s0 |
| 195 |
inhibits fall-back to slower routines. |
| 196 |
.TP |
| 197 |
.B \s-1TMPDIR\s0 |
| 198 |
Name of the temporary directory. |
| 199 |
If not set, the environment variables |
| 200 |
.B \s-1TMP\s0 |
| 201 |
and |
| 202 |
.B \s-1TEMP\s0 |
| 203 |
are inspected instead and the first value found is taken; |
| 204 |
if none of them are set, |
| 205 |
a host-dependent default is used, typically |
| 206 |
.BR /tmp . |
| 207 |
.SH DIAGNOSTICS |
| 208 |
The exit status is zero if and only if all operations were successful. |
| 209 |
Missing working files and \*os are silently ignored. |
| 210 |
.ds EY 1990, 1991, 1992, 1993 |
| 211 |
.SH IDENTIFICATION |
| 212 |
Author: Walter F. Tichy. |
| 213 |
.br |
| 214 |
Manual Page Revision: \*(Rv; Release Date: \*(Dt. |
| 215 |
.br |
| 216 |
Copyright \(co 2010-2022 Thien-Thi Nguyen. |
| 217 |
.br |
| 218 |
Copyright \(co \*(EY Paul Eggert. |
| 219 |
.br |
| 220 |
Copyright \(co 1982, 1988, 1989 Walter F. Tichy. |
| 221 |
.br |
| 222 |
.SH "SEE ALSO" |
| 223 |
.BR ci (1), |
| 224 |
.BR co (1), |
| 225 |
.BR ident (1), |
| 226 |
.BR rcs (1), |
| 227 |
.BR rcsdiff (1), |
| 228 |
.BR rcsmerge (1), |
| 229 |
.BR rlog (1), |
| 230 |
.BR rcsfile (5). |
| 231 |
.PP |
| 232 |
Walter F. Tichy, |
| 233 |
\*r\*-A System for Version Control, |
| 234 |
.I "Software\*-Practice & Experience" |
| 235 |
.BR 15 , |
| 236 |
7 (July 1985), 637-654. |
| 237 |
.PP |
| 238 |
The full documentation for \*r is maintained as a Texinfo manual. |
| 239 |
If the |
| 240 |
.BR info (1) |
| 241 |
and \*r programs are properly installed at your site, the command |
| 242 |
.IP |
| 243 |
.B info rcs |
| 244 |
.PP |
| 245 |
should give you access to the complete manual. |
| 246 |
Additionally, the \*r homepage: |
| 247 |
.IP |
| 248 |
.B http://www.gnu.org/software/rcs/ |
| 249 |
.PP |
| 250 |
has news and links to the latest release, development site, etc. |
| 251 |
.SH BUGS |
| 252 |
At least one |
| 253 |
.I file |
| 254 |
must be given in older Unix versions that |
| 255 |
do not provide the needed directory scanning operations. |
| 256 |
.br |