Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
it CHange OWNer of hadoop directory and everything under it (-R) to hadoop:handoop (user:group). see the chown manual: linux.die.net/man/1/chown –  LiuYan 刘研 Jun 24 '11 at 1:38
1  
The 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. –  Caleb Jun 24 '11 at 6:37

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
    
For the sake of completeness, I would only add that changing file/directory ownership requires root permissions, therefore the chown command is run with sudo. –  Petr Uzel Jun 24 '11 at 5:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.