我们团队中的某个人想要递归更改用户主目录中所有隐藏目录的用户权限。为此,他执行了以下命令:
cd /home/username chown -R username:groupname .*
当我们意识到他实际上递归地更改了 /home 中所有用户目录的权限时,我们感到非常惊讶,因为.*equals to..也是如此。不过,您会在 Linux 中预料到这种行为吗?
.*
..
shell bash directory wildcards dot-files
bash ×1
directory ×1
dot-files ×1
shell ×1
wildcards ×1