The chown command in Linux is used to change the ownership of files and directories. It allows you to modify both the user and group ownership of a specified file or directory. The basic syntax of the command is:
chown [OPTIONS] NEW_OWNER:NEW_GROUP FILE
NEW_OWNERspecifies the new user who will own the file.NEW_GROUPspecifies the new group that will own the file.FILEis the name of the file or directory whose ownership you want to change.
For example, to change the owner of a file named example.txt to the user labex and the group to staff, you would use:
chown labex:staff example.txt
To execute the chown command, you typically need superuser (root) privileges, which can be obtained by prefixing the command with sudo.
