rajbirsingh9725
Posts: 4
Joined: Thu May 11, 2017 10:01 pm

Linux command

Thu May 11, 2017 10:10 pm

CHOWN

The chown command changes the user and/or group that owns a file. It normally needs to be run as root using sudo e.g. sudo chown pi:root *filename* will change the owner to pi and the group to root.

I am not getting the function of this command.
Owner to pi and the group to root
please explain.........

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Linux command

Fri May 12, 2017 12:46 am

In Linux everything has a permission. So you can for example set a file to have read write execute privileges for everyone, meaning anyone can read if, write it, or execute it. There are three permissions for every file. One for the user that is the owner, one to a group, and one to everyone else. So you can make that the owner can do everything, the group and only read and execute, and everyone else can only execute.

Groups are just a collection of users. Your user is in many different groups.
There are 10 types of people: those who understand binary and those who don't.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Linux command

Fri May 12, 2017 2:48 am

rajbirsingh9725 wrote:I am not getting the function of this command.
Owner to pi and the group to root
please explain.........
Type:

ls -lh

and you'll see each file with its permissions, owner, size and name. There are command line programs for changing the owner, the group, the permissions and the name of those files, e.g.:

chmod
chown
mv

rajbirsingh9725
Posts: 4
Joined: Thu May 11, 2017 10:01 pm

Re: Linux command

Sat May 13, 2017 5:14 am

Thanks ....for your help. Now i get that point, that what it really want to convey.

Return to “Other programming languages”