Running any command in bash, using the asterisk *
, causes the shell to select all files and directories in the folder you are in right now. The -R
flag will make sure the subdirectories and subfiles are modified aswell. Be aware, that the directory where you are itself will not be modified. If you want to modifiy the current folder, you should use the dot .
.
Summary:
$ cd newdirectory/
$ chown newuser * -R
├─ newdirectory/ # not modified
│ ├─ subdirectory/ # modified
│ │ └── subfile/ # modified
│ └─ file # modified
$ cd newdirectory/
$ chown newuser . -R
├─ newdirectory/ # modified
│ ├─ subdirectory/ # modified
│ │ └── subfile/ # modified
│ └─ file # modified