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.
