I am working on a test machine.
I just discovered that I have misunderstood the way the following command is run.
chown -Rv some_user:users /some_folder/*
This command do exactly what I want. Change the owner of every things from the named folder and in all child folders.
But of course it leave untouched all hidden object like '.some_dir' and '.some_file'
So I run the following command ( and problem arise )
chown -Rv some_user:users /some_folder/.*
I can see on the screen that the command is climbing up one directory level doing something like
should change the owner of the folder /some_folder and all its files and sub-directories.
If you don't want to change the ownership of /some_folder the following will work for all hidden files with the second character being lower-case letters:
chown -Rv some_user:users /some_folder/.[a-z]*
so it will pick up files such as .bashrc but not .SciTEUser.properties .
Obviously you can extend the pattern to allow upper-case and numerals if necessary.
Attention: the SysV chown changes the target of symbolic links; normally you want to change the owner of the symbolic links so you need the -h option
(old Linux chown was different, like BSD chown).
In a shell glob the [!.] is any character but a dot. (A few shells have [^.] in addition, that is not portable).
would change all files (including hidden IF you have access rights to them) at that level.
Then adding -R switch to that command line would cause the whole tree below that point to also change ownership IF you have access rights to all of that.
But if I remember correctly ( but I may wrong ), I did that command on command line from terminal, on user level for a particular user, ( /home/another_user ).
No, it is because .* matches .. and .
Test the glob expansion with echo!
This is for the arguments = start files.
If one of the start files is a directory, chown -R will recurse into it and find ALL files.
The problem with your guess is that UNIX doesn't have hidden files.
When you use readdir() , it does not hide dot files. Hiding dot files is not a UNIX filesystem feature, UNIX kernel feature, or UNIX library feature.
Its a shell feature. And ls, grandfathered in from 45 years ago.
Meaning, there are two and only two ways to implicitly exclude dot-files:
Getting the list of files from the shell a la chown -R user:pass path/*
Getting the list of files from ls a la ls | xargs chown -R user:path
The command you listed will never exclude dot-files. Either you did something like the above and omitted it not thinking it relevant, or the dot files have a different owner than you expected, or some filesystem magic like immutable bits is preventing you from changing them.
Just doing ls -l /path/to/.dotfile and posting the result would have solved this argument for good a week ago.