You are not logged in.
Hi,
I read in the man pages for the 'chmod' program that using "X" instead of "x" resulted in directories being made executable. However, I'm finding that when I use this on a directory recursively, the files also are made executable. For example, I want to do this:
sudo chmod -R o+X /etc/rc.d
However, this results in *everything* being executable... not just directories. Am I misunderstanding the purpose of "X"? Could someone explain why this isn't working and how to make it work? Thanks in advance.
I found this website for the time being that explains how to do this, but I was hoping this feature was intrinsic to "chmod". Perhaps that's asking for too much?
Last edited by void.pointer (2008-09-01 17:16:22)
Offline
find /directory -type d -exec chmod o+x {} \;should work.
-edit-
Yeah, that's in the link you added.
Last edited by lucke (2008-09-01 17:15:01)
Offline
Yes, this works perfectly! Thank you.
Offline
I just tested that big X stuff and it seems to be working as well.
Offline
I just tested that big X stuff and it seems to be working as well.
Doesn't work for me for some reason.
Offline
Look at the snippet below. Notice how after running the command, both files *and* directories are set to executable by "others":
[robert@server subversion]$ sudo chmod -R o=rX .
[robert@server subversion]$ ls -l
total 9504
-r-xr-xr-x 1 robert users 3424 2008-08-31 13:58 PKGBUILD
dr-xr-xr-x 4 robert users 4096 2008-09-01 11:54 pkg
dr-xr-xr-x 3 robert users 4096 2008-09-01 11:50 src
-r-xr-xr-x 1 robert users 3035598 2008-09-01 11:54 subversion-1.5.2-1-x86_64.pkg.tar.gz
-r-xr-xr-x 1 robert users 6646636 2008-08-27 15:56 subversion-1.5.2.tar.gz
-r-xr-xr-x 1 robert users 2907 2008-08-02 21:42 subversion-neon.patch
-r-xr-xr-x 1 robert users 177 2008-08-02 21:42 svn
-r-xr-xr-x 1 robert users 804 2008-08-02 21:42 svnserve
-r-xr-xr-x 1 robert users 121 2008-08-02 21:42 svnserve.confOffline
Why o=rX, not o+X? (edit: I mean, maybe that r confuses it)
Point of interest, in zsh "chmod o+X directory/**/*(/)" would work.
Last edited by lucke (2008-09-01 17:33:31)
Offline