Eventually /dev/null

Random thoughts from an emerging Programmer

Find: Missing Argument to `-exec`

That’s maybe some common Error you’re receiving, when you’re new to find and the exec parameter. So I encountered the Problem as well.
After a short research within the man page of find the problem was found: ; needs to be escaped with a Backslash \. The look over to my commandline just showed that this was already the case. Now the internet was asked and most results just reveal the same thing: escape the ; with a Backslash.
Some hits later I found a german page where they told that it’s even required that the \; is separated from the previous commands with a space \;. So it’s not enough to write:

wrong invocation
1
find <query> -exec <command>{}\;

, it needs to be (notice the extra whitespace between command and {}):

correct invocation
1
find <query> -exec <command> {} \;

Well from my point of view some mistake which can be fast overseen, even more if you suppose that {}\; should work out nicely as it’s something which occurs often or everytime within the exec(at least these groups of signs).