LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Unable to remove files (https://www.linuxquestions.org/questions/linux-software-2/unable-to-remove-files-475156/)

solarize 08-18-2006 12:07 PM

Unable to remove files
 
I've copied several files from a cd to my harddrive. Now I want to remove them by using rm. Unfortunately I always get the message 'permission denied' while the permissions are set correctly. Does anybody know how I can remove cd copied files

bigrigdriver 08-18-2006 01:05 PM

The permission on the files may be correct. But, are the permission on the folder in which you stored them set to allow write permission?

Did you use root permissions to copy the files? If so, normal user can't rm them.

Have you tried su to root, then try to rm the files?

solarize 08-18-2006 02:39 PM

The files were copied under my user name. Also the dir and the files have my username as owner. I do not have root permission on the system, but that probably shouldn't matter, because I'm the owner of the files. I think it has something to do with attribute settings (such as immutability) of the files....

soggycornflake 08-18-2006 02:54 PM

Quote:

Originally Posted by bigrigdriver
Did you use root permissions to copy the files? If so, normal user can't rm them.

Well, if the user owns the directory and has write permission to it he can.

Quote:

Originally Posted by solarize
I think it has something to do with attribute settings (such as immutability) of the files....

What fs is this on? This is only relevant on an ext2 filesystem, reiserfs for example, does not have attribute flags. Immutability has to be set manually, did you do this? Check it with lsattr <files>. If the i flag is set, remove it with chattr -i <files>.

Quote:

Originally Posted by solarize
Also the dir and the files have my username as owner.

What about the permissions? If you used cp -r to copy a directory tree from the CD, then it will be readonly...

farslayer 08-18-2006 02:57 PM

If you do a ls -al and look at the permissions on the file does it provide any clues ?
without knowing the permissions it will be hard to tell you why you can't delete them..

solarize 08-18-2006 03:41 PM

Quote:

What about the permissions? If you used cp -r to copy a directory tree from the CD, then it will be readonly...
Yes, that is the way I copied them. How can I delete readonly files? Are readonly special files?

In any case, here is the file listing in dir uml/:

dr-xr-xr-x 3 poude ii 512 Aug 18 14:13 .
drwxr-xr-x 10 poude st-ai 512 Aug 18 14:14 ..
-rwxrwxrwx 1 poude ii 137314307 Aug 18 14:13 UML_sp1_win.exe
drwxrwxrwx 2 poude ii 512 Aug 18 17:39 tmp

when I do

rm -rf uml/

I get:

rm: Unable to remove directory uml//tmp: Permission denied
rm: Unable to remove directory uml/: File exists

solarize 08-20-2006 06:09 AM

Problem solved... the uml dir was not writable


All times are GMT -5. The time now is 05:54 PM.