We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


could not delete file in unix

sumanth_ora asked
Medium Priority
Last Modified: 2010-04-21

  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.
Watch Question

Top Expert 2007

What error do you get?

Are you the owner of the file?

Is the file on a NFS mounted filesystem?
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
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.
Top Expert 2005

> 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).
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.