rm -R

doug at safeport.com doug at safeport.com
Sat Mar 2 23:29:16 UTC 2013



On Sat, 2 Mar 2013, David Tilbrook wrote:

> Wjy are we syill having this conversation?
> The problem (and its solution) have been
> raised for at least 39 years.
>
> To specify a file, directory, device, whatever,
> whose leaf name begins with a `-', name it using
> a leading `./' as in:
>
>      whatever ./-S
>
> That will work for all programs, even those that
> do not support -- to terminate flags.
>
> Furthermore it will support glob patterns.
>
> Now was that so difficult?
>
> -- dt

Also find <dir> -type [df] -name "string" | xargs command

find is pretty good about finding names with special characters and they get 
passed though xargs ok. This does not work with names with spaces of course. 
Also pretty easy to test at each step to make sure you are doing want you 
intend.


More information about the freebsd-questions mailing list