Can someone in detail explain what exactly the following command that a tutorial has instructed me to issue is doing?
chown -R $USER:$GROUP
Can someone in detail explain what exactly the following command that a tutorial has instructed me to issue is doing?
chown -R $USER:$GROUP
From the man page https://linux.die.net/man/1/chown
So it's recursively setting owner and group for any subsequently specified directory, and all below it.
chown [OPTION]... [OWNER][:[GROUP]] FILE..
-R, --recursive
operate on files and directories recursively
chown basically means changing the ownership of filesystem object(s) like files,directories and links etc.
chown -R $USER:$GROUP file1 dir1 ...
here we are doing two things
file1
and dir1
to $USER
simultaneouslyfile1 dir1
to $GROUP
echo user=$USER group=$GROUP
prior to running thechown
. That will definitively report to you the values that the variables currently have. – steve Jun 24 '17 at 19:45