pepe_botika69
pepe_botika69

Reputation: 67

What does this strange construction "{} \;" means?

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

Answers (2)

BubbaKush
BubbaKush

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.

Link

Hope It is useful.

Upvotes: 1

francesco
francesco

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

Related Questions