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

Re: shell or fileutils commands and whitespaced filenames



Michael wrote:
> (pls reply to me i'm offlist)
> 
> This may be somewhat OT but i know many debianos are shell experts.
> I always got these problems with whitespaced filenames using shell
> or fileutils commands , and currently use to do much circumstance
> with tr, sed, print, and what-the-heck. I just think, in the 21th
> century, there should be a straight way using chmod, chown, xargs
> directly. I still hope i just didn't discover the easy way.  I
> invested 15 google minutes but without success, and now i just think
> it's much faster to simply ask somewhere :) - pls any enlightenment ?

Try using find and xargs.  Here are some examples.

  find . -print0 | xargs -r0 chmod a+rX

  find . -type f -print0 | xargs -r0 ls -ld

  find . -type d -print0 | xargs -r0 chmod g+ws

  find . -name '*.html' -print0 | xargs -r0 chmod a+r,a-x

Bob



Reply to: