Change Ownership Of Files

1
18
[user1@fedora12 ~]$ su
Password:
[root@fedora12 user1]# touch file1
[root@fedora12 user1]# chown user1 file1
[root@fedora12 user1]# ls -l file1
-rw-r–r– 1 user1 root 0 2009-12-22 15:31 file1
[root@fedora12 user1]# chgrp user1 file1
[root@fedora12 user1]# ls -l file1
-rw-r–r– 1 user1 user1 0 2009-12-22 15:31 file1
[root@fedora12 user1]#

Its a regular need in Linux to change Ownership of Files and Folders,

From GUI it can be done with Few clicks , but it is recommended to change from Console

To Change File Ownership/ Group Ownership we musst be in a privileged zone

For this Go to Super user mode first, and create a test file say file1

[user1@fedora12 ~]$ su

Password:

[root@fedora12 user1]# touch

Now change ownership of this file using chown

[root@fedora12 user1]# chown user1 file1

[root@fedora12 user1]# ls -l file1

-rw-r–r– 1 user1 root 0 2009-12-22 15:31 file1

Now Change Group Ownership using chgrp

[root@fedora12 user1]# chgrp user1 file1

[root@fedora12 user1]# ls -l file1

-rw-r–r– 1 user1 user1 0 2009-12-22 15:31 file1

[root@fedora12 user1]#

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here