I understand . means current directory, and * means any string. My question is the following 2 commands have the same result? I would appeciate your help.
chown -R joe:staff .
chown -R joe:staff *
I understand . means current directory, and * means any string. My question is the following 2 commands have the same result? I would appeciate your help.
chown -R joe:staff .
chown -R joe:staff *
*
expands to all filenames in the current directory, excluding hidden files (whose names start with .
).
So
chown -R joe:staff *
changes the ownership of all non-hidden files and directories in the current directory, and all the contents of all the non-hidden directories in the current directory.
chown -R joe:staff .
changes the ownership of the current directory and all its contents, including hidden files and directories.
They don't have the same result: the first doesn't change the current directory or hidden files in the current directory.
chown -R joe:staff .
changes more, and (2) neither changes anything above it. Is that right?
– ngungo
Mar 05 '17 at 19:01