In order to change both a file's owner and group we can do this:
chown trump file
chgrp trump file
but can I do both commands in one approach or one command?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityper chown man page chown user:group file
:
chown trump:trump file
chown
manual states "Previous versions of the chown utility used the dot (.
) character to distinguish the group name. This has been changed to be a colon (:
) character, so that user and group names may contain the dot character." The RHEL man page for chown
does not have that usage note. Nonetheless, there are reasons to abstain from using the .
character.
Aug 3, 2017 at 17:31
username:
and :groupname
are not standards - see unix.stackexchange.com/a/136989/383045
Sep 22, 2021 at 1:51