Chown - error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Chown - error
# 1  
Old 02-19-2010
Chown - error

I have a file fin2009_4.txt.gz in the unix ftp server. Owner of the file is: ftpusr.

Code:
-rw-r--r--   1 ftpusr   sap          0 Feb 19 10:19 fin2009_4.txt.gz

When I try to delete this file after copying to my home folder, I am getting the following error.

Code:
rm:  fin2009_4.txt.gz1: override protection 644 (yes/no)?

Pleae let me know how do I delete this file withoug being prompted?

I tried changing the owner of the file by using the below, but no success.

Code:
chown <MY_USER_NAME> fin2009_4.txt.gz

chown: fin2009_4.txt.gz: Not owner

Please help.

Last edited by zxmaus; 02-19-2010 at 07:50 PM.. Reason: added code tags
# 2  
Old 02-19-2010
Code:
rm -f

would delete it without asking for confirmation.

The y/n question is more about permissions than about ownership. If you have write permissions to the directory, you can delete it. If the file doesn't belong to you, or it doesn't have write permissions for you, then it will ask.
# 3  
Old 02-20-2010
Thanks Scott. I am able to delete the files now.

I have a problem something similar to this. I copied a directory from one of my fellow users belonging to the same user group to my home path. I still the see the actual owner's name. How do I make myself the owner of the directory that is copied to my directory. I used chown and it doesn't work.

Code:
drwxr-xr-x   8 user1 usergrp       1024 Jan 14 13:53 Financials

I have copied the directory Financials to my home directory. Now I need to change the owner from user1 to user2 (my user id). When I use "chown" it is throwing an error

Code:
chown user2 Financials
chown: Financials: Not owner



---------- Post updated at 11:07 AM ---------- Previous update was at 10:35 AM ----------

I even asked user1 to issue the command chown and even he gets the same message that he is not a owner. It is weird.
# 4  
Old 02-20-2010
If you use cp, make sure the -p option is not used. Perhaps you have an alias set to "cp -p" somewhere. What happens if you issue:
Code:
\cp -r Financials Financials2

Financials2 should have you as the owner this time.

If that is the case you can then remove Financials:
Code:
rm -rf Financials

and
Code:
mv Financials2 Financials

# 5  
Old 02-20-2010
It works. Thanks a lot for your prompt response.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Chown error in Solaris

Hello All, I am trying to change the home directory ownership of a user from "skel" to user himself, drwxr-xr-x 4 skel aldo 4096 May 26 09:47 dosatc But when i do that i get an error stating, # chown -R dosatc /msdhome/dosatc #chown: getcwd: Too many open files Please guide me... (3 Replies)
Discussion started by: gull05
3 Replies

2. UNIX for Dummies Questions & Answers

Pls help. can't do chown ????

I am trying to change the directory to owner of Sybase. But I get permission denied. I did login as root. newd1> ls -l total 58 drwxr-xr-x 2 prod develop 5 Oct 17 06:51 bin drwxr-xr-x 2 prod develop 7 Oct 17 07:18 etc dr-xr-xr-x 1 root root 1... (15 Replies)
Discussion started by: samnyc
15 Replies

3. Solaris

chown

Hello My oracledatabase creats some xmlfiles. this files has the owner hugo. now I've a script (how runs als hugo2) and this script will insert this XMLFile into the database. But that doesn't work, because the owner of the files is wrong, and hugo has not the rights to insert this files into... (3 Replies)
Discussion started by: Street
3 Replies

4. AIX

Trouble in chown

I'm a owner of directories or files why I can't deliver the ownership of them up to other users? (1 Reply)
Discussion started by: kang
1 Replies

5. Shell Programming and Scripting

cp, chown, untar

hello i want shell script. i have a source.txt /home/user409/public_html/test/ /home/user09876/public_html/xdsss/ /home/user9765/public_html/320xxx/ . . . maybe 1000 lines i want . 1.read a source.txt 2.untar special.tar.gz into these directory in source.txt 3.i want to... (14 Replies)
Discussion started by: topic32428285
14 Replies

6. UNIX for Dummies Questions & Answers

chown

is there a difference in chown on a file or a directory? how do i chown a directory and all the contents? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

7. UNIX for Dummies Questions & Answers

Chgrp and Chown ???

Hi Can anybody please let me know the usage of Chgrp command with an example??? Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

8. UNIX for Advanced & Expert Users

chown issue

I have a strange problem in my Linux box (Suse). Recently I took over this box as admin even though I have no prior admin experience. Following is my issue I had following users under 'root' group initially user1 user2 user3 Since I did not like user ids under root group. I modifed these... (9 Replies)
Discussion started by: praveenkumar_l
9 Replies

9. AIX

chown

hello chown not change ownership before: 205:system ~kuku chown kuku:system ~kuku after no change 205:system ~kuku aix box can someone help me? ariec (2 Replies)
Discussion started by: ariec
2 Replies

10. UNIX for Dummies Questions & Answers

chown and permissions

how i could give to user permission(delete,execute and so on) and ownership to files? Thanks (1 Reply)
Discussion started by: ithost
1 Replies
Login or Register to Ask a Question