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

1 Answer 1

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.

2
  • So, (1) chown -R joe:staff . changes more, and (2) neither changes anything above it. Is that right?
    – ngungo
    Commented Mar 5, 2017 at 19:01
  • That's exactly it. Commented Mar 5, 2017 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .