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. James
* James D. Parra
Moved into a directory (on its own partition) three tiers deep; for example within /home/user/directory. Issued the command 'chown -R username * .*' and
chown -R username * ./.*
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???
Looks like it understood you to say 'present directory and all others' rather than 'present directory and those below', ie: .* vs ./.* -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery2
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>
On Thu, 2006-02-23 at 13:23 -0800, 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 * .*'
chmod -R username * covers all files and subdirs and using .* would also cover all parent dirs as well since .. is the parent dir and . is a valid character for the wild card expansion. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998
participants (4)
-
Anders Johansson
-
James D. Parra
-
Ken Schneider
-
Patrick Shanahan