linux change file/folder ownership

Changing file ownership

$ chown ownername folder/filename

$ chown user1 /myfolder

$ chown mikky file.txt

$ chown -R mikky /myfiles/photos

//change the group of file.
$ chown :game data.txt

//the owner is set to charly followed by a colon and a group ownership is set to game group
$ chown charly:game data.txt

Changing group ownership of a file/folder

chgrp [options] group FSO

 

$ chgrp group_name file_name

 

ref: https://en.wikipedia.org/wiki/Chown

ref : https://en.wikipedia.org/wiki/Chgrp

Author: bm on May 9, 2016
Category: ubuntu