命令中的点(。)是什么意思?

WubiUbuntu980 Unity7难民

这是我在教程中看到的命令:

mkswap /swap && chown root. /swap && chmod 0600 /swap && swapon /swap

什么.意思

钢铁司机

.在这种情况下是一个弃用形式:,并且是新的所有者和组之间的隔板。

来自info chown

   Some older scripts may still use ‘.’ in place of the ‘:’ separator.
POSIX 1003.1-2001 (*note Standards conformance::) does not require
support for that, but for backward compatibility GNU ‘chown’ supports
‘.’ so long as no ambiguity results.  New scripts should avoid the use
of ‘.’ because it is not portable, and because it has undesirable
results if the entire OWNER‘.’GROUP happens to identify a user whose
name contains ‘.’.

因此,在这种情况下,它与相同chown root: /swap,这意味着

OWNER:
     If a colon but no group name follows OWNER, that user is made the
     owner of the files and the group of the files is changed to OWNER’s
     login group.

由于root的登录组是root,因此等效于chown root:root /swap

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章