Reputation: 67
Why do we use this strange construction {} \;
in linux terminal for exec command?
For example,
find . -type f -name *.jpeg -exec rm {} \;
Upvotes: 0
Views: 89
Reputation: 60
Looking for info I found this post in AskUbuntu which I think is family from StackOverflow where an User ask the same as you.
Hope It is useful.
Upvotes: 1
Reputation: 7539
From the man page of find (emphasis mine):
find . -type f -exec file '{}' \;
Runs `file' on every file in or below the current directory. Notice that the braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation. The semicolon is similarly protected by the use of a backslash, though single quotes could have been used in that case also.
Upvotes: 3