bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #61774] Docs for find -delete out of sync


From: Bernhard Voelker
Subject: Re: [bug #61774] Docs for find -delete out of sync
Date: Wed, 2 Feb 2022 09:29:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/1/22 23:15, admin4 wrote:
> get the point, left to right processing of arguments, okay but, when 
> someone reads or writes this one-liner:
> 
> find . -delete -name "*f25020672.avi*"
> 
> nobody would have guessed that it will delete everything (send this one liner 
> to 10x friends and ask them (without trying it out! so maybe in person or in 
> a videocall) what this one-liner will do...
> 
> will bet [...]  that 90%  will say "it will delete this file
> f25020672.avi and all files that are similar like ABCf25020672.aviABC

Well, the command line of find(1) is not a natural language where one
can exchange the pieces of the sentence at will (and the recipients would
still do what one was thinking).
The precise sentence of the intended behavior would be:
  "Search for files in and below the working directory whose name matches
   the pattern "*f25020672.avi*" and delete them."

As such, there's nothing we can do about it than the documentation warning
we have in place.
It's like in real-life: know your tools, and if you don't know them, then
read the documentation, read it twice, then make tests on a sample, improve
your skills and confidence, and finally apply the tool on the subject you
want.

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]