Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created March 22, 2012 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pwenzel/2158739 to your computer and use it in GitHub Desktop.
Save pwenzel/2158739 to your computer and use it in GitHub Desktop.
change permissions for all files and folders with xargs
# change permissions for all files, skipping dirs
find . -type f | xargs chmod 664
# change permissions for all dirs, skipping files
find . -type d | xargs chmod 775
@ole-tange
Copy link

Beware of the separator problem: pi.dk/5

@quamis
Copy link

quamis commented Aug 9, 2019

for those not wanting to click on short links, @ole-tange's link points to https://en.wikipedia.org/wiki/Xargs#Separator_problem

@quamis
Copy link

quamis commented Aug 9, 2019

I've ended up doing find . -type d -print0 | xargs -0 chmod 777
thx @ole-tange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment