1

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 *
ngungo
  • 141

1 Answers1

2

* 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.

Stephen Kitt
  • 434,908