changing the owner of a file

Every file has a owner, usually the person who created it. When you create a file, you are its owner. The owner usually has broader permissions for manipulating the file than other users.

Some times you need to change the owner of a file, for example if you take over the responsibility for a file that previously belonged to others.

The chown command takes two arguments ; the login name of the new owner and name of the file.

  • $chown k2 k2schools

in the above example, k2 is the new owner and k2schools is the file.

Note: Only the owner of a file (or super user) can use chown to change its ownership

Changing the group of files:

Every file belongs to group. Sometimes, such as new groups are set up on a system or when a files are copied to a new system, you may want to change the groupto which a particular file belongs. This can be done using the chgrp (change group) command

The chrgp command take 2 arguments; the name of the new group and name of the file.

  • $chgrp k2 k2schools

Note: Only the owner of a file (or super user) can use chown to change the group to which it belongs.

CheapSexCams
You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools
%d bloggers like this: