Monday, May 2, 2011

Change file ownership in Linux

How to Change the Ownership of a File in Linux

I listed the file using the command ls -l in terminal.
The command displayed the ownership of the file as my.
-rw-r--r-- 1 my my 420 2011-05-02 11:03 IP.dat


I need to convert the ownership of IP.dat file to root

Type the command,
chown root:root IP.dat
in terminal.

The command has changed the ownership of the file to root
-rw-r--r-- 1 root root 420 2011-05-02 11:03 IP.dat

No comments:

Post a Comment

Thanks for visiting my Blog....Ur comments n suggestions are most valuable for me...Thanks