mass chmod command-need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sexybabe
    Confirmed User
    • Jun 2005
    • 3129

    #1

    mass chmod command-need help

    i have sitemap.htm on all my sites (around 150) in my server.i want to chmod from 644 to 666.
    is there shell script to mass chmod these particular files?
    i tried this code but not working.
    chmod -R 666 fullsitemap.htm
  • roly
    Confirmed User
    • Aug 2002
    • 1844

    #2
    Originally posted by sexybabe
    i have sitemap.htm on all my sites (around 150) in my server.i want to chmod from 644 to 666.
    is there shell script to mass chmod these particular files?
    i tried this code but not working.
    chmod -R 666 fullsitemap.htm
    i'm not an expert on this stuff but maybe

    chmod -R 666 */fullsitemap.htm

    Comment

    • drjones
      Confirmed User
      • Oct 2005
      • 908

      #3
      Originally posted by sexybabe
      i have sitemap.htm on all my sites (around 150) in my server.i want to chmod from 644 to 666.
      is there shell script to mass chmod these particular files?
      i tried this code but not working.
      chmod -R 666 fullsitemap.htm
      something like this:

      cd /your/web/root
      find ./ -name sitemap.htm -exec chmod 666 "{}"\;

      It should recursively chmod all the sitemap files in all the subdirectories of your web root.

      Or if that has problems, this might work:

      cd /your/web/root
      chmod 666 `find ./ name sitemap.htm`
      ICQ: 284903372

      Comment

      • drjones
        Confirmed User
        • Oct 2005
        • 908

        #4
        Also, BTW.. you sure you want to make those files on your webserver world writeable? Seems like whatever your trying to accomplish, theres gotta be a better way. Generally, its very bad practice to do something like that.

        ICQ: 284903372

        Comment

        • sexybabe
          Confirmed User
          • Jun 2005
          • 3129

          #5
          thanks i will try this

          Comment

          Working...