What does "sudo chown -R hadoop:hadoop hadoop" do?
8,154
The command chown
changes the ownership of files or directories.
The -R
flag makes the command recursive, ie. it is applied to all the files and sub-directories inside given directory.
The string hadoop:hadoop
changes the ownership (user:group
).
The final hadoop
is the name of the directory whose ownership is going to be changed.
Author by
user785099
Updated on September 18, 2022Comments
-
user785099 almost 2 years
I saw the following script, posted online, that was used during the hadoop installation process.
sudo tar xzf hadoop-0.20.2.tar.gz sudo mv hadoop-0.20.2 hadoop sudo chown -R hadoop:hadoop hadoop
I do not quite understand. What does the
sudo chown -R hadoop:hadoop hadoop
do here? Thanks for the explanation.
-
LiuYan 刘研 about 13 yearsit CHange OWNer of
hadoop
directory and everything under it (-R) tohadoop:handoop
(user:group). see thechown
manual: linux.die.net/man/1/chown -
tcoolspy about 13 yearsThe syntax of linux commands is always listed in the man page. You can look up what any command and it's options by pulling up it's manual like this:
man chown
.
-
-
Petr Uzel about 13 yearsFor the sake of completeness, I would only add that changing file/directory ownership requires root permissions, therefore the chown command is run with sudo.