changing permissions of a file

Asked by Russell Booth

This all started when I was doing a little bit of cleaning up on my computer, I deleted the desktop icon for my pictures file which I am sure was just a like, anyhow, this deleted all that folder off the hard drive instead of just the desktop icon when I emptied the trash.

Luckily I had the file backed up on my hard drive, I've reloaded it onto the hard drive but I now have the problem where I have 2 sets of files , one is a root file and the other is a normal file (my file), the desktop icon is showing up as being locked.

I am trying to change the permissions of this file so I can delete it and just have the normal unlocked file(s) on there which I am the owner of.

Normally , the root files are located in the root directory but this one isn't, I've tried everything mentioned and it hasn't worked.

Can anyone tell me how to unlock and delete that file?

All I wanted on the desktop was an association (link) to that file, but what I have now is the root version of that file located in the desktop file , all the other files in it also have root permission, I wish to change this.

I'm thinking maybe copying the file onto disc then deleting then, then reloading them back onto the hard drive.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Dmitry Shachnev
Solved:
Last query:
Last reply:
Revision history for this message
Best Dmitry Shachnev (mitya57) said :
#1

You can use `sudo' command in the Terminal:
sudo rm -f /path/to/file

Or, alternatively, you can set you as the owner:
sudo chown yourusername:yourusername /path/to/file
and then delete it as usual.

Revision history for this message
enubuntu (mr.tennents) said :
#2

Please try to do this:
1. Open a terminal by hitting CTRL + ALT + T
2. Insert and run this command:
gksu nautilus

3. Navigate to the directory with the protected file and click on it with the right click then select property.
4. Select in the new window the permission tab and change the access to the file for your account.

ATTENTION: Don't remove anything when you use gksu nautilus!! Keep attention on what you do because you are a SUPER USER and you can damage your system!!!

After this you can close all and try to open the file with your user.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

You can also chown the file to your user in command line and then do as you wish. Glad you had a backup :)

Revision history for this message
Russell Booth (rbooth10) said :
#4

Thanks for that , this solved my problem (the sudo chown command), on occasions though I had to change the filename to unlock the files because for some reason, it wouldn't work with filenames with more than one word in them.