How to Change User File and Group Ownership In Linux

Aside from changing file permissions, you may come across a situation that requires changing the user file ownership or even group ownership.

Performing either of these tasks requires you first need to switch to superuser privileges. Use one of the options outlined in the previous passage.

To change the file ownership use the chown command:

chown [user_name] [file_name]

Instead of [user_name] type in the name of the user who will be the new owner of the file.

To change the group ownership type in the following command:

chgrp [group_name] [file_name]

Instead of [group_name] type in the name of the group that will be the new owner of the file.

Leave a Reply

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