Everyday use tips

A set of HOWTO notes for myself - just to avoid reinventing the bicycle when I need to repeat some system setup or do some tricks in code.

Everyday use tips

Postby averk » Wed Jun 10, 2009 7:21 am

chmod for files / directories only:
Code: Select all
find ./ -type d -print0|xargs -0 chmod 770
find ./ -type f -print0|xargs -0 chmod 660
User avatar
averk
Site Admin
 
Posts: 15
Joined: Tue Aug 12, 2008 6:33 pm

Re: Everyday use tips

Postby Ghost » Wed Jul 22, 2009 1:07 am

averk wrote:chmod for files / directories only:
Code: Select all
find ./ -type d -print0|xargs -0 chmod 770
find ./ -type f -print0|xargs -0 chmod 660


My variant:
Code: Select all
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;


IMHO last variant is better, because xargs (all) comand line params is limited to 32768 bytes. In my variant, for any found file chmod is executed, without length limit for command line.
User avatar
Ghost
 
Posts: 1
Joined: Wed Aug 13, 2008 6:40 am

Re: Everyday use tips

Postby averk » Mon Aug 17, 2009 7:38 am

Ъ
User avatar
averk
Site Admin
 
Posts: 15
Joined: Tue Aug 12, 2008 6:33 pm


Return to Reminder notes

Who is online

Users browsing this forum: No registered users and 1 guest

cron