chown : Change Owner And Group File or Directory

We can get information from a file in Linux with command :

ls -l

This is output from my file :

-rw-r–r– 1 root root 0 2011-03-09 13:50 tesfile

If we want to change file owner and group this file from root to toto, we can use this command :

chown root:toto tesfile

This command will change group file. Check  status of file  with command ls -l

-rw-r–r–  1 root toto         0 2011-03-09 13:50 tesfile

Change owner of file with command :

chown toto tesfile

Check  status of file  with command ls -l

-rw-r–r–  1 toto toto         0 2011-03-09 13:50 tesfile

If we want to change owner and group file or directory with all subdirectory, we can add option -R in chown command.

2 thoughts on “chown : Change Owner And Group File or Directory

  1. I do trust all of the concepts you have presented for your post. They’re really convincing and will definitely work. Nonetheless, the posts are too quick for novices. Could you please lengthen them a bit from next time? Thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.