[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

could not delete file in unix

Hi,


  I have a file(Below mentioned) in unix.Could not delete it with rm command.Bascially i down loaded this file for gzipl(gzip exe).Please help me on this.

-rw-r--r--   1 jg88723  aml       507392 Mar  8 16:48 gzipl

please help me on this.
0
sumanth_ora
Asked:
sumanth_ora
1 Solution
 
TintinCommented:
What error do you get?

Are you the owner of the file?

Is the file on a NFS mounted filesystem?
0
 
yuzhCommented:
if you login name is not jg88723 and you current session is not the super user root, you don't have permission to delete the file.

You can su as root (if you know the password) to delete or ask your sys adm to do it for you.
0
 
subratabiswasCommented:
As pointed by yuzh, you can not delete a file if you are neither the administrator (root) nor the owner of the file. If you are indeed the owner of the file (jg88723  in this case), it is still possible not to be able to delete the file. This happens when the write permission from the parent directory of the file is removed after the file is created.

Solution: Go to the directory that contains the parent directory of this file. For example if the above ls command was used from directory /user/home/temp/data1, then go to directory /user/home/temp/ . If you do an ls here, you will see that the write privilege on the directory has been removed. Change the privilege by executing the following:

$ chmod u+w data1

Now the directory will be writable. It would now be possible to go to the directory where file gzipl is executing and remove the file.

The whole solution is only applicable of you are owner of the file and the directory.
0
 
ravenplCommented:
> As pointed by yuzh, you can not delete a file if you are neither the administrator (root) nor the owner of the file.
Correction. You don't have to own the file. You have to have write permission to the directory it resides in (unless there is sticky bit set on the dir).
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now