SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    chmod -R - why isn't it working?

    I'm trying to use chmod recursively e.g.

    chmod -R 705 *.cgi

    ... which should recursively chmod all files, in the current and sub-directories with the extension .cgi, to 705.

    I'm sure there's a simple explanation, but I've looked up all
    the (very dry) tutorials I could find (including 'man chmod'),
    and I don't see where I'm going wrong.

    Perhaps I am losing my wits, that could be it. Too many late
    nights giggling insanely and cursing my pc.

    =====

    (Thinks) Errr... do I have to specify the directory? As in:
    chmod -R 705 footle/*.cgi

    ... or something like that?


    I am loathe to test this theory, as I don't want to have to
    correct it by hand if I'm wrong [ and I'm lazy].
    Last edited by Tiger_Tom; Jun 4, 2001 at 09:11.

  2. #2
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Attleboro, MA, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that should work, if you have permission to modify those files already. without specifying a directory, chmod assumes the current dir.

    make a couple directories in /tmp and touch some files into them and test it on them instead.

    BTW if it still doesn't work, what OS (and distro) are you using?

  3. #3
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,204
    Mentioned
    106 Post(s)
    Tagged
    1 Thread(s)
    Are you trying to do this on a NT box? If so, chmod doesn't work. You need to use a control panel provided by your host or have them make the changes for you...
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  4. #4
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gentlemen, thank you for your replies. Sorry for not replying
    sooner. My account at this forum didn't seem to work,
    yesterday. [Thanks to admins for fixing it, BTW?]

    Anyway:

    1. I am on Linux
    2. chmod -R 705 footle/*.cgi does not seem to work.

    I can chmod the whole directory and ALL it's contents recursively with:

    chmod -R 705 footle


    ... but that isn't terribly useful.

    I was hoping that some-one might know for definite what to
    do, as from my previous experience I could waste a lot of
    time trying to guess the correct syntax.


    Maybe it isn't possible?
    Last edited by Tiger_Tom; Jun 6, 2001 at 04:12.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i just tried (an equivelent):

    chmod 705 directory/*.blah -R

    and that seemed to work ?!?!?!

    ummmmmm....

    i dunno...........

  6. #6
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, it doesn't work for me.

  7. #7
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Attleboro, MA, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Tiger_Tom
    1. I am on Linux
    2. chmod -R 705 footle/*.cgi does not seem to work.

    I can chmod the whole directory and ALL it's contents recursively with:

    chmod -R 705 footle

    ... but that isn't terribly useful.


    well...

    unless you have a directory named *.cgi in footle/ "chmod -R 705 footle/*.cgi" doesn't need the -R

    "chmod 705 *.cgi" in the directory where the CGIs are (ie: footle) should work. if it doesn't then something else is wrong.

    BTW, you may want to try using the +/- commands instead. they work by replacing 705 with letters: u = user g = group o=others; x=executable/listable r=readable w=writeable

    so:
    chmod u+rwx *.cgi
    chmod g-rwx *.cgi
    chmod o+rx *.cgi

    or:
    chmod u+rwx,g=,o=rx

    = sets ONLY those bits specificied and clears anything not specified

    hope that helps

  8. #8
    SitePoint Zealot Tiger_Tom's Avatar
    Join Date
    Feb 2000
    Location
    U.K.
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I can't therefore recursively chmod files of a particular extension, then?

    .....
    CHMOD

    Drat!
    Last edited by Tiger_Tom; Jun 7, 2001 at 08:34.


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
  •