chown – change file/directory ownership
IMPORTANT: chown
needs to be run as root
.
chown example
As root user, let’s create a file named try
:
it belongs to user root
and group root
:
Now let’s change ownership to user greys
and group wheel
See Also
- Basic Unix Commands
- Unix Commands
- ls command
- cd command
- chmod vs chown
- Filesystem navigation commands
- pwd command
- chown examples