version 1.78, 2010/07/15 20:51:38 |
version 1.79, 2010/09/19 23:48:58 |
|
|
space, tab, and newline |
space, tab, and newline |
.Pq Sq \en |
.Pq Sq \en |
characters. |
characters. |
Alternatively, the |
Consider using |
.Fl print0 |
.Fl print0 |
primary may be used in conjunction with the |
instead. |
.Fl 0 |
|
option to |
|
.Xr xargs 1 , |
|
allowing all file names to be processed safely. |
|
.It Fl x |
.It Fl x |
Prevents |
Prevents |
.Nm |
.Nm |
|
|
.It Ic -print0 |
.It Ic -print0 |
This primary always evaluates to true. |
This primary always evaluates to true. |
It prints the pathname of the current file to standard output, followed |
It prints the pathname of the current file to standard output, followed |
by a null character. |
by a null character, suitable for use with the |
|
.Fl 0 |
|
option to |
|
.Xr xargs 1 . |
.It Ic -prune |
.It Ic -prune |
This primary always evaluates to true. |
This primary always evaluates to true. |
It causes |
It causes |
|
|
.Pp |
.Pp |
.Dl "$ find /usr/src -path /usr/src/gnu -prune -or -name \e*.[0-9]" |
.Dl "$ find /usr/src -path /usr/src/gnu -prune -or -name \e*.[0-9]" |
.Pp |
.Pp |
Find and remove all *.jpg files in the current working directory: |
Find and remove all *.jpg and *.gif files under the current working |
|
directory: |
.Pp |
.Pp |
.Dl "$ find . -name \e*.jpg -exec rm {} \e;" |
.Dl "$ find . \e( -name \e*.jpg -or -name \e*.gif \e) -exec rm {} \e; |
or |
or |
.Dl "$ find . -name \e*.jpg | xargs rm" |
.Dl "$ find . \e( -name \e*.jpg -or -name \e*.gif \e) -print0 | xargs -0r rm" |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr chflags 1 , |
.Xr chflags 1 , |
.Xr chmod 1 , |
.Xr chmod 1 , |
|
|
and |
and |
.Ql \&; |
.Ql \&; |
may have to be escaped from the shell. |
may have to be escaped from the shell. |
|
.Pp |
|
Passing the output of |
|
.Nm |
|
to other programs requires some care: |
|
.Pp |
|
.Dl "$ find . -name \e*.jpg | xargs rm" |
|
or |
|
.Dl "$ rm `find . -name \e*.jpg`" |
|
.Pp |
|
would, given files |
|
.Dq important\ .jpg |
|
and |
|
.Dq important , |
|
remove |
|
.Dq important . |
|
Use the |
|
.Ic -print0 |
|
or |
|
.Ic -exec |
|
primaries instead. |
.Pp |
.Pp |
As there is no delimiter separating options and file names or file |
As there is no delimiter separating options and file names or file |
names and the |
names and the |