find: missing argument to « -ok »

A while ago, I ran chmod to change some file permissions to 777. A friend of mine told me to never chmod 777, so I decided to change the permissions again.
So, first I looked for all the 777 files:

find ~ -perm 777

I get a few files, it’s OK.

Then I try to convert them into 755 files:

find ~ -perm 777 -ok chmod 755 {};

And I get this error message:

find: missing argument to « -ok »

What did I do wrong?

Asked By: Damien

||

You need a space between the {} and the ;.

Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.