I noticed the command chown -R user:group *
ran as root won't affect dot files like .htaccess, unless I specify them one by one, like chown -R user:group .htaccess
How to make chown -R user:group *
effective on dot files too?
I noticed the command chown -R user:group *
ran as root won't affect dot files like .htaccess, unless I specify them one by one, like chown -R user:group .htaccess
How to make chown -R user:group *
effective on dot files too?
I had to use chown -R user:group .*
because the wildcrd in bash does not expand to dot files by default, unless the dot is explicitly specified.
That behavior may be changed with shopt -s dotglob
, which sets the option to always includes hidden files when expanding filename patterns (known as "globbing").
chown -R user:group * .*
to match both dot files and non-dot files. – lgeorget Apr 27 '16 at 10:36/home/foo
, you'll end up chowning all of/home
. – marcan Apr 27 '16 at 10:51