Change Ownership Of Files

[user1@fedora12 ~]$ su
[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]#

  • Meet Author

    S.Abhilash, started this blog in the later half of 2009 as a self hosting site for all his previous blogging attempts. , My way of writing and frequency of publishing may not be uniform as my resources are my projects nd issues i came across. For the last few years this blog is reacing 100 s of unique visitors each day, thanks wordpress and google for such a perfection in their software and services.

    Head to Authors Page | Abhilash on Facebook



Category Linux Shell     Tags , , , , , , , , , , ,

Comment on Facebook

1 Comment to “Change Ownership Of Files”

Community



FREE News Letter

Enter your email address

See Also

Resources

Please Submit your Email Address to Get Latest Technology News As it Happens


Enter your email address


Read previous post:
Drupal 6 installation Failed at Set up database

While installing Drupal with Mysql all went fine and i did the instructed things as Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php. insted of...

Close