Here is a command that I saw in a tutorial:
mkswap /swap && chown root. /swap && chmod 0600 /swap && swapon /swap
What does the .
mean?
Here is a command that I saw in a tutorial:
mkswap /swap && chown root. /swap && chmod 0600 /swap && swapon /swap
What does the .
mean?
The .
in this context is a deprecated form of :
and is a separator between the new owner and group.
From 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 ‘.’.
So in this context it's the same as chown root: /swap
, which in turn means
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.
Since root's login group is root
, it's equivalent to chown root:root /swap
It is a shortened version of
sudo chown root:root /swap
as it will set the group to the same as the username.
Try creating a folder, then set the ownership to root that same way, then when completed, try setting the ownership to your username.
sudo chown $USER. folder/
Hope this help!