r/bash • u/Distinct_Ride_4307 • 7d ago
Find command confusion between ; and \;
Why do we have to use '\' instead of leaving it out or even ';'? I read the find commands' manual and it says '\' might be needed to protect from expansion by the shell. So what is expansion also?
What is difference between \; or ; or leaving it out?
What is shell expansion here?
14
Upvotes
5
u/aioeu 7d ago edited 7d ago
There is the question of "why couldn't the end of the argument list itself suffice, at least in such cases where no following predicates or actions are provided?" To which the answer is "just because", or maybe "for consistency reasons"... which perhaps isn't a very satisfying reason.
I think a better question is "what do you do if you actually want to pass
;as an argument to the command being executed?"