Re: chmod hidden files



On Mon, 15 May 2006 20:02:56 -0400, Mercury wrote:

Well, I'm trying to use * as the wildcard, but this doesn't get the hidden
files.

chmod -R XXX *

where XXX are the permissions.

That doesn't do what I want (doesn't chmod the hidden files) - what will?

Hmmm, here is what I have
/home/bittwister/tmp/junk
/home/bittwister/tmp/junk/l1
/home/bittwister/tmp/junk/l1/l2

$ ls -al l1/l2/.a*
-rwxrwxr-x 1 bittwister bittwister 0 May 15 12:24 l1/l2/.aaa
-rw-r--r-- 1 bittwister bittwister 0 May 15 13:00 l1/l2/.aab

$ chmod -R 775 *

ls -al l1/l2/.a*
-rwxrwxr-x 1 bittwister bittwister 0 May 15 12:24 l1/l2/.aaa
-rwxrwxr-x 1 bittwister bittwister 0 May 15 13:00 l1/l2/.aab

$ chmod -R 777 *
ls -al l1/l2/.a*
-rwxrwxrwx 1 bittwister bittwister 0 May 15 12:24 l1/l2/.aaa
-rwxrwxrwx 1 bittwister bittwister 0 May 15 13:00 l1/l2/.aab

What can also be happing is you are removing/changing privs on directories
which prevents changes below that directory.

For current directory you can do
chmod xxx * .*

and/or
chmod xxx * .* */* */.* */*/* */*/.*

Anytime you what to see what happens with command line expansion, do a
ls -al (your string here) Example:

ls -al * .* */* */.* */*/* */*/.*

If you do not want to change directory perms you will need to use
find. If filenames contain any white space characters you may want to
use something like

find . -type f -name "*" -print0 | xargs -r0 chmod 755

For extra points, read
man find
man xargs
.



Relevant Pages

  • Re: File and Folder permissions..
    ... Do not set fixed permissions that may be wrong, use chmod g+w to add write access for the group. ... Backup,,, A cronjob that change ctime every hour will tag all files as candidates for incremental backup, only change the files that need to be changed. ... A file has one owner, and if someone need to change it, just make a copy and change the copy, so your wife now are the owner of her version. ...
    (alt.os.linux.suse)
  • Re: apache permission problem please help
    ... Ok as anyone reading this thread knows i have huge mess on hands. ... chmod -R 701 home ... mailclients but i moved one and had to modify the permissions all over ... >>apache was unable to use these files. ...
    (freebsd-questions)
  • Regarding man CHMOD command
    ... Can someone please patiently explain the following man file for CHMOD ... I changed the permissions for my pendrive ... write by owner ... Depending on the file system, ...
    (comp.unix.shell)
  • Re: setting file permissions on a web server
    ... If permissions are kept intact you can ... you transfer first and chmod on the server. ... Since I'm running Windows, I assume that I can't run the chmod line on my own computer. ... My web server uses Unix, but is it possible for me to have access to a command line for the server? ...
    (comp.lang.python)
  • Regarding man CHMOD command
    ... Can someone please patiently explain the following man file for CHMOD ... I changed the permissions for my pendrive ... write by owner ... Depending on the file system, ...
    (comp.unix.shell)