LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell prog syntax (https://www.linuxquestions.org/questions/linux-newbie-8/shell-prog-syntax-4175426985/)

skp 09-12-2012 11:26 PM

shell prog syntax
 
find . -type f -exec chmod 644 {} \;

can any one please explain the working of {} \; in this syntax

pan64 09-13-2012 12:33 AM

see man find and look for -exec:
Quote:

All following arguments to find are taken to be arguments to the command until an argument consisting of ';' is encountered. The string '{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, not just in arguments where it is alone, as in some versions of find. Both of these constructions might need to be escaped (with a '\') or quoted to protect them from expansion by the shell. See the EXAMPLES section for examples of the use of the -exec option.


All times are GMT -5. The time now is 04:42 AM.