change owner

Dear All,

i have a file and i want to change the owner of that file from another user.

for example

[tdmscrdr scripts]$ ls -l pkc.txt
-rw-r--r-- 1 tdmscrdr dba 717 Nov 2 17:10 pkc.txt

the owner of pkc.txt file is tdmscrdr and group is dba

i want to change the owner of this file from another user...
for example

[oracle scripts]$

the oracle user is also belongs to same group that is dba group.
i want to change the owner of the pkc.txt file from oracle user

but every time i'm getting a msg that is permission denied.

is there any way to solve the problem?
please help...

Thanks,
Regards,
Panksj

Ask an administrator with root access to do it.

Or login as the user you want to have the file as, create a file, copy the contents of the original file over the top of it, rename the new file to the old file name.

Dear All,

I'm using bash shell.
in that i'm trying to set
umask 770

in the .bash_profile file...
but its not working...
but i have read and write permission.

can any body help

Thanks,
Regards,
Panksj

Use the chown command to change the owner of the user

chown owner file

I assumed he was using that and it was giving permission denied.

That's not a good umask.

In a umask the bits are set for the attributes you don't want set.

So you would want

umask 007

you may want to consider

umask 027

The classic "umask 022" stops others writing to your files.

Dear Porter,

thanks for ur help...but ur suggestion is also not working...
can i have some more idea?

Thanks,
Regards,

What exactly did you try, how and why did it fail?