Change permissions for directories only - Questions

This is a discussion on Change permissions for directories only - Questions ; Can chmod be used for changing permissions for directories only and/or files only? In other words in a directory/file structure like folder --- subfolder1 ------ file1 ------ file2 --------- subfolder2 ------------ file3 --- subfolder2 ------ file4 (etc.) I want all ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Change permissions for directories only

  1. Change permissions for directories only

    Can chmod be used for changing permissions for directories only and/or files
    only? In other words in a directory/file structure like

    folder
    --- subfolder1
    ------ file1
    ------ file2
    --------- subfolder2
    ------------ file3
    --- subfolder2
    ------ file4

    (etc.)

    I want all files to be 644 and all folders to be 755. It seems that it is
    an all or nothing exercise. chmod -R * and then go back and do the folders
    individually? Hopefully there's an easier way. Thanks.



  2. Re: Change permissions for directories only

    gf wrote:

    > I want all files to be 644 and all folders to be 755.**It*seems*that*it*is*
    > an all or nothing exercise.**chmod*-R***and*then*go*


    .... you could use find/chmod together
    ..
    --
    << http://michaeljtobler.homelinux.com/ >>
    ***
    *******
    *********
    ****** Confucious say: "Is stuffy inside fortune cookie."
    *******
    ***


  3. Re: Change permissions for directories only

    "mjt" wrote in message
    news:gy01d.14068$w%6.5961@newsread1.news.pas.earth link.net...
    > gf wrote:
    >
    >> I want all files to be 644 and all folders to be 755. It seems that it is
    >> an all or nothing exercise. chmod -R * and then go

    >
    > ... you could use find/chmod together
    > .
    > --
    > << http://michaeljtobler.homelinux.com/ >>



    Please explain this for the masses. Give an example relating to my original
    question. Thanks.

    __________________________________________________ ________________
    Gaylen Fraley - Founder / Owner
    Raven Web Hosting http://ravenwebhosting.com
    PHP KISGB PHP Guest Book for Standard and phpNuke sites
    http://www.ravenphpscripts.com
    PHP KISSQ PHP Stock Quote for Standard and phpNuke sites
    http://www.ravenphpscripts.com
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ



  4. Re: Change permissions for directories only



    gf wrote:

    > Can chmod be used for changing permissions for directories only and/or
    > files
    > only? In other words in a directory/file structure like
    >
    > folder
    > --- subfolder1
    > ------ file1
    > ------ file2
    > --------- subfolder2
    > ------------ file3
    > --- subfolder2
    > ------ file4
    >
    > (etc.)
    >
    > I want all files to be 644 and all folders to be 755. It seems that it is
    > an all or nothing exercise. chmod -R * and then go back and do the
    > folders
    > individually? Hopefully there's an easier way. Thanks.


    find folder -type d | xargs chmod 755
    find folder -type f | xargs chmod 644

    --
    remove .nospam from e-mail address to reply

  5. Re: Change permissions for directories only

    find folder -type d -exec chmod 755 {} \;
    find folder -type f -exec chmod 644 {} \;

    gf wrote:

    > Can chmod be used for changing permissions for directories only and/or
    > files
    > only? In other words in a directory/file structure like
    >
    > folder
    > --- subfolder1
    > ------ file1
    > ------ file2
    > --------- subfolder2
    > ------------ file3
    > --- subfolder2
    > ------ file4
    >
    > (etc.)
    >
    > I want all files to be 644 and all folders to be 755. It seems that it is
    > an all or nothing exercise. chmod -R * and then go back and do the
    > folders
    > individually? Hopefully there's an easier way. Thanks.



  6. Re: Change permissions for directories only

    Thanks so much!



  7. Re: Change permissions for directories only

    Stu wrote in message news:...
    > find folder -type d -exec chmod 755 {} \;
    > find folder -type f -exec chmod 644 {} \;


    Two of my personal favourites... :-)
    -Koppe

+ Reply to Thread