How to change only the user owner?

QuestionsQuestions8 SkillsProPermissions of FilesDec, 05 2025
065

To change only the user owner of a file or directory without affecting the group ownership, you can use the chown command with just the new owner's username followed by the filename. The syntax is as follows:

sudo chown new_owner filename

For example, if you want to change the owner of a file named example.txt to datauser, you would use:

sudo chown datauser example.txt

This command will change the owner of example.txt to datauser while keeping the group ownership unchanged.

0 Comments

no data
Be the first to share your comment!