Thursday, July 14, 2011

How to change a file's/folder owner and group in Linux

#To change the owner of a file or directory, the command chown is used.
chown username <file or directory>

  For recurssivly
  chown -R username <file or directory>

#To change the group of a file or directory, the command 'chgrp' is used.
chgrp groupname <file or directory>

  For recurssivly
  chgrp -R groupname <file or directory>