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