[Linux-disciples] 'find' and chown

Stephen R Laniel steve at laniels.org
Thu Sep 30 16:47:15 EDT 2004


Using chown or chmod with the '-R' option, if you ask it to
set permissions for dotfiles, seems to be a mistake. I've
made that mistake a few times before: it starts recursing
through the entire filesystem, because it's copying even the
files '.' and '..'.

The alternative I use now is 'find'; I just do

find . -exec chown [blah] '{}' ';'

This gets both dotfiles and non-dotfiles, and only recurses
through subdirectories of the current directory. Is that the
only way to do what I want? 

-- 
``Giblets knows that there are some out there who will say,
  'Oh, but countries like Saudi Arabia and Syria can do
  torture cheaper and better than we can, why should we try to
  compete?' Well, Giblets is holding a little something in the
  thumbscrews of his heart called patriotism, and Giblets
  thinks American workers can compete with anyone else in the
  world! Sure, these other countries have been at it longer
  than we have, but with gumption and stick-to-it-iveness
  Americans can rise to the top of anything!''
 -http://shorl.com/jefynulorugu



More information about the Linux-disciples mailing list