[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash script problem



Hi,

On 2021-08-05 8:07 p.m., Greg Wooledge wrote:
> On Thu, Aug 05, 2021 at 08:01:22PM -0400, Polyna-Maude Racicot-Summerside wrote:
>> find . -type d -exec chmod -v 0644 '{}' \;
>>
>> to change the folder
>>
>> find . -type f -exec chmod -v 0755 '{}' \;
>>
>> to change files
> 
> You've switched the permissions around.  You want 644 on the files, and
> 755 on the directories.
> 
Indeed, I changed permission between folders and directories.

> Use + instead of \; to make them more efficient.  Also, you don't need
> to quote the {} argument.  I've never been able to figure out where
The quote around {} come from the man page of chmod.
What does + make as a difference ?
> that tradition came from, because I've never seen *any* shell where
> it's needed.  But at least it's harmless.
> 

Thanks for adding those useful information :)
-- 
Polyna-Maude R.-Summerside
-Be smart, Be wise, Support opensource development

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: