Hi, This might be a little O.t. so private responses please. I've got apache and samba running on a CentOS5 box enabling windows users to add web content. My issue is i've had to restore some backup data that was previously archived. The permissions aren't matching up so i'm wanting to use find and xargs to change them appropriately. Normally i do: find . -type type |xargs chmod value "{}"\; which usually works. My issue is the files were made with spaces so find isn't able to find them. Does anyone have a workaround? Some urgency! Thanks. Dave.
Shad L. Lords
2007-Nov-20 18:19 UTC
[CentOS] manipulating files and directories with spaces
> Hi, > This might be a little O.t. so private responses please. > I've got apache and samba running on a CentOS5 box enabling windows > users to add web content. My issue is i've had to restore some backup data > that was previously archived. The permissions aren't matching up so i'm > wanting to use find and xargs to change them appropriately. Normally i do: > find . -type type |xargs chmod value "{}"\; > which usually works. My issue is the files were made with spaces so find > isn't able to find them. Does anyone have a workaround? Some urgency!try: find . -type type -print0 | xargs -0 chmod value -Shad
Kenneth Porter
2007-Nov-21 01:19 UTC
[CentOS] manipulating files and directories with spaces
--On Tuesday, November 20, 2007 1:14 PM -0500 Dave <dmehler26 at woh.rr.com> wrote:> My issue is the files were made with spaces so find isn't able to find > them.Good to know about the -print0 trick. My rule of thumb is that when I see a space in a filename, that's a clue that a directory is likely needed to group content together. Not necessarily true for end users, but almost always true in my programming work. Just as spaces provide semantic boundaries in natural language, directory separators provide such boundaries in filesystem organization. For example, instead of creating a folder named "my company's photos for 2007", I'd create "Company/Photos/2007". My office is a mess, but my disk stays highly organized. ;)