There is command that change the folder permission for all subfolders

find . -type d -exec chmod 755 {} \;

I understand d is for directory and chmod 755 to make all directory as 755

I want to know what is the meaning of {} & \.

  • Server Fault is a site for information technology professionals](serverfault.com/help/on-topic) -- as such we have certain professional expectations when people ask a question here, and one of those expectations is that your question shows a professional attitude and you at least looked at the manual. - Linux/UNIX systems come with online documentation; nearly everything (including the man command itself) is documented with man <cmd> although sometimes more the detailed info <cmd> is used. – HBruijn Oct 29 '16 at 17:16

Reading manuals for another person: $50/hr. {} is a placeholder and \ is an escape symbol.

man find:

-exec utility [argument ...] ;

True if the program named utility returns a zero value as its exit status. Optional arguments may be passed to the utility. The expression must be terminated by a semicolon (“;”). If you invoke find from a shell you may need to quote the semicolon if the shell would otherwise treat it as a control operator. If the string “{}” appears anywhere in the utility name or the arguments it is replaced by the pathname of the current file. Utility will be executed from the directory from which find was executed. Utility and arguments are not subject to the further expansion of shell patterns and constructs.

  • 4
    "Reading manuals for another person: $50/hr" :D – Janne Pikkarainen Oct 26 '16 at 8:50
  • How many hours did it take? – Tero Kilkanen Oct 26 '16 at 12:25
  • Until the very death. – drookie Oct 26 '16 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.