James D. Parra wrote:
Hello,
This may be a syntax problem, although I didn't expect the following behavior.
Moved into a directory (on its own partition) three tiers deep; for example within /home/user/directory. Issued the command 'chown -R username * .*' and expected to have all the files in and under the current directory changed to the current owner, which it did, however chown also changed the ownership on all the directories above the current dir', including all the directories under /home and /home itself. What happened??? Apparently that is the wrong syntax for chmod, but why would it move up from its current dir'? There were no soft links to /home in this user's directory either. I am having a fun day today.
Again, many thanks for your help.
If you set the environment variable to something, for example export GLOBIGNORE=.:.. then * will never match . or .. and it has the added benefit that your command could be written chown -R username * and it would catch all files, including the . files. you can put this line in your .bashrc By the way, for this particular case, it would also work to do chown -R username <top level directory name>