Can’t Delete File In Ubuntu

By Randy Jensen | Jan 2, 2009

Delete Me FolderSometimes you’ll notice that one of your files has a lock icon next to it. This usually means that for some reason, you are no longer the owner of the folder/file.

This can happen for a variety of reasons, but it’s fairly easy to correct, albeit a real nuisance sometimes. Here are a list of commands to take back ownership of just about any folder or file on Ubuntu.

Note about the examples and commands below:

  • You can usually leave out GROUP as I did in my examples
  • If you see a ‘\’ slash, it’s because my folder name had a space in it and this is needed to let Ubuntu know that there is a space in the file/folder name, not a new command.

An empty folder

Command: sudo chown USERNAME:GROUP /LOCATION/OF/FOLDER
Example: sudo chown randy /home/randy/Desktop/Delete\ Me

A folder with files inside

Command: sudo chown -R USERNAME:GROUP /LOCATION/OF/FOLDER
Example: sudo chown -R randy /home/randy/Desktop/Delete\ ME

A file

Command: sudo chown USERNAME:GROUP /LOCATION/OF/FILE
Example: sudo chown randy /home/randy/Desktop/myfile.jpg

Several files

Command: sudo chown USERNAME:GROUP file1.jpg file2.htm file3.png
Example: sudo chown randy image1.jpg index.htm bob.png


Copy the code below to your web site.
x 
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Design Float
  • DZone
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

Related posts:

  1. Can’t Empty Trash In Ubuntu 8.04 and 8.10 Seems
  2. Quick Samba Tip: Locations Of Samba Shares In Ubuntu With t
  3. Dead Simple File Sharing Between Any Operating System Since
  4. Mount NTFS Formatted Harddrives In Ubuntu Even t
  5. SSH Host Verification Failed Error Fix A coup

Related posts brought to you by Yet Another Related Posts Plugin.

blog comments powered by Disqus
© 2009 Randy Jensen Online, - PassionDuo WordPress Theme