Linux command: chown

Quick startchownCommand to change the owner of a file

There is one for every file/directory in an operating system like Linux or macOS (usually every UNIX system)owner.

The owner of the file can use it for all operations. It can determine the fate of the file.

Owner (androotUser) can also usechowncommand:

chown <owner> <file>

like this:

chown flavio test.txt

For example, if you have the owner of a fileroot, You cannot write to it as another user:

you can use itchownTransfer ownership to you:

It is often necessary to change the ownership of a directory and recursively change all files contained in it, as well as all subdirectories and files contained in it.

you can use it-Rbanner:

chown -R <owner> <file>

The file/directory not only has an owner, but also hasgroup. With this command, you can make changes while changing the owner:

chown <owner>:<group> <file>


chown flavio:users test.txt

You can also usechgrpcommand:

chgrp <group> <filename>

ThischownThis command can be used in Linux, macOS, WSL and wherever you have a UNIX environment

Download mine for freeLinux Command Manual

More cli tutorials: