Results 1 to 4 of 4

Thread: Use find with directories with spaces for stdout

  1. #1
    Join Date
    Apr 2006
    Beans
    170
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Use find with directories with spaces for stdout

    I'm trying to change the rights of a number of directories. But some of the directories have spaces in the names. It's only about the directories, not about the files in them.

    So far I came up with the next line:

    chmod g+rw `find * -type d`

    But I notice it cannot handle the dirs with spaces in the names.

    How do I handle these dirs aswell?
    AMD X2-4850e / 6150 / 2048 MB / 7600GT

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Use find with directories with spaces for stdout

    Code:
    find . -type d -exec chmod g+rw {} \;

  3. #3
    Join Date
    Apr 2006
    Beans
    170
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Use find with directories with spaces for stdout

    Thanks a lot! That answer made a lot of things clear to me.
    AMD X2-4850e / 6150 / 2048 MB / 7600GT

  4. #4
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Use find with directories with spaces for stdout

    If your thread is solved, please mark your thread solved by selecting Mark this thread as solved from the Thead Tools.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •