1.\" clean.1 manpage
2.\" $Id: clean.1,v 1.5 2005/02/18 00:21:39 cws3 Exp $
3.\"
4..
5.Dd July 4, 2003
6.Dt CLEAN 1
7.Os
8.Sh NAME
9.Nm clean
10.Nd automatically remove unwanted files
11.Sh SYNOPSIS
12.Nm
13.Op Fl bifloqVw
14.Op Fl t Ar days
15.Op Fl eE Ar glob
16.Op Fl xX Ar exclude
17.Op Ar directory ...
18.Sh DESCRIPTION
19The
20.Nm
21utility searches through the filesystem for "temporary files" which can be
22deleted safely.
23.Pp
24The options are as follows:
25.Bl -tag -width Ds
26.It Fl b
27batch mode: Wait until all subdirectories have been traversed and then
28prompts to delete the complete list of matching files (default)
29.It Fl i
30interactive mode: Prompt for deletion of each file as it is
31found.  Also, allows entire directory trees to be skipped at the prompt.
32.It Fl f
33force mode: Run the program quietly and automatically delete all
34matching files.  This switch recommended only for expert users.
35.It Fl l
36flat mode: Only clean the current directory; do not enter subdirectories.
37.It Fl o
38object files: Add *.o, *.pyc, *.pyo to the list of regex patterns to search for.
39.It Fl q
40Quiet mode: Do not echo the directory names while traversing the filesystem.
41.It Fl V
42Version number: Print the version number of the program.
43.It Fl t Ar days
44time mode: only eliminate files that are more than
45.Ar days
46old.
47.It Fl e Ar glob
48Use this expression without using the the .cleanrc or the
49default list (as appropriate).  Can be used more than once.
50.It Fl E Ar glob
51Use this expression in addition to the .cleanrc or the
52default list.  Can be used more than once.
53.It Fl x Ar glob
54Exclude this directory name from the traversal.  This
55overrides the .cleanrc and the default list.  Can be used more than once.
56.It Fl X Ar glob
57Exclude this directory name from the traversal.  This is
58in addition to the .cleanrc and the default list.  Can be used more than once.
59.Pp
60If no directory is specified, then clean defaults to the current
61directory.  Only one of
62.Fl b ,
63.Fl i ,
64or
65.Fl f
66may be specified.  Also,
67.Fl e
68and
69.Fl x
70may not be used in conjunction with
71.Fl E
72and
73.Fl X .
74.Sh How globbing works, using your own .cleanrc, and the default .cleanrc:
75A glob expression may include regular characters as well as
76"wildcards".  For the definition of globbing see the appropriate part
77of the
78.Xr sh 1
79man page.
80.El
81.Pp
82To make your own .cleanrc, create a file in your home directory name
83".cleanrc" and put in it any glob expressions that you would like
84clean to look for.  Also, you may put in the names of directories that
85you want to exclude from the search.  The names of the directories
86should be prefixed with a `!'.  A `#' at the beginning of a line
87represents a comment.
88.Pp
89The default .cleanrc would look something like this:
90.Pp
91.Bd -literal -offset ident
92# Default .cleanrc
93#
94# Expressions to match
95core
96*~
97.*~
98*.BAK
99.*.BAK
100*.CKP
101.*.CKP
102*.NEW
103.*.NEW
104\\#*#
105.emacs_[0-9]*
106dead.letter
107*.otl
108.*.otl
109*.backup
110.*.backup
111# End of default .cleanrc
112.Ed
113.Pp
114.Sh WARNING
115This program was written with the express purpose of deleting (unwanted)
116files.  Please be certain that you understand this program and that you really
117want to use such an automatic deletion process before you begin.
118