Sobes.tech
Junior — Middle

How is the transfer of ownership rights to a directory carried out in the system?

sobes.tech AI

Answer from AI

In Unix-like operating systems, changing ownership of a directory (or file) is done using the chown command. This command allows you to change the owner and/or group of a directory.

Example usage:

sudo chown newowner:newgroup /path/to/directory

Here, newowner is the new owner, and newgroup is the new group. If you only want to change the owner, you can specify just the owner:

sudo chown newowner /path/to/directory

It is important to note that changing ownership usually requires superuser (root) privileges. You can also recursively change the owner for all nested files and directories using the -R option:

sudo chown -R newowner:newgroup /path/to/directory