How to Unlock a file?
I am a Linux dummy and was recently trying unzip and install a file.
Anyway, long story short, I ended up with a 'locked' file in my Documents. I would appreciate it if someone could tell me how to 'unlock' it, so that I can delete it. Your help will be appreciated. Lewis. **** |
You've probably put the file there as the super (or root) user. So you need to change the ownership of it to 'unlock' it.
Open up a console (I think it's in Accessories, might be called a terminal? If you can't find it, hit Ctrl-Alt-F2 and login there, when finished hit Ctrl-Alt-F7), then find the directory where it is stored. If it's on your desktop, then: Code:
cd Desktop Code:
pwd Once you're in the right place (ie, when you type ls, the file is listed): Code:
chown user file Have a google at 'linux permissions' And, in a console, try Code:
man cd |
Re: How to unlock a file?
Quote:
Unfortunately I was not successful with it. werq@1[~]$ cd Documents werq@1[Documents]$ ls lshw-B.02.07 (I edited the list down to the offending file) werq@1[Documents]$ chown werq lshw-B.02.07 werq@1[Documents]$ There was just NO response from the command. Kind regards. Lewis. ***** |
No response = action successful.
|
Sorry, i left something out.
Try: Code:
sudo chown user file or, if you just want the file gone Code:
sudo rm file https://wiki.ubuntu.com/RootSudo |
Re: How to unlock a file?
Quote:
When I first looked, the action had not been completed, so I was disappointed and shut the machine down. After rebooting the 'locked' has gone. Kind regards. Lewis. ***** |
Re: How to unlock a file?
Quote:
Kind regards. Lewis. ***** |
Failed for me need help
Quote:
evailya@evailya-laptop:~$ cd Desktop evailya@evailya-laptop:~/Desktop$ ls World of Warcraft wow wowmatrix evailya@evailya-laptop:~/Desktop$ chown evailya World of Warcraft chown: cannot access `World': No such file or directory chown: cannot access `of': No such file or directory chown: cannot access `Warcraft': No such file or directory evailya@evailya-laptop:~/Desktop$ the World of Warcraft file is the one that is locked |
You have spaces in the filename so use double quotes:
evailya@evailya-laptop:~/Desktop$ chown evailya "World of Warcraft" |
Still not working
I have done all of the steps even added the quotation marks and it is still locked this is what i get
evailya@evailya-laptop:~$ cd Desktop evailya@evailya-laptop:~/Desktop$ ls World of Warcraft wow wowmatrix evailya@evailya-laptop:~/Desktop$ chown evailya "world of Warcraft" chown: cannot access `world of Warcraft': No such file or directory evailya@evailya-laptop:~/Desktop$ chown evailya "World of Warcraft" evailya@evailya-laptop:~/Desktop$ So i restarted my compter after each time i got that response because the other person said when he got no response it worked after restarting but not mine what else could it be |
Evailya:
Can you paste the output of Code:
ls -la Code:
sudo chown .... |
The file is in the evailya /home directory and you are running the command as user evailya and it is locked. You need to log in as root user, enter root password and then run the command.
Also, as suggested above, do chown. This needs to be done as root user also. You may need to use sudo command, you didn't indicate which version of Linux you are using. Case sensitivity at command line, World of Warcraft is not the same as world of warcraft. If there are caps, you need to use caps in the command. If everything is lower case letters, you need to use lower case letters. |
Quote:
evailya@evailya-laptop:~/Desktop$ ls -la total 3224 drwxr-xr-x 4 evailya evailya 4096 2010-06-16 21:22 . drwxr-xr-x 50 evailya evailya 4096 2010-06-18 13:39 .. dr-xr-sr-x 11 evailya evailya 4096 2010-06-15 21:32 World of Warcraft drwxr-xr-x 4 evailya evailya 4096 2010-06-16 21:23 wow -rwxr-xr-x 1 evailya evailya 3284161 2009-10-27 06:35 wowmatrix evailya@evailya-laptop:~/Desktop$ as yancek asked I am running Zorin to my knowledge i was able to figure out how to log in as root user but I do not know the root commands I need to unlock it |
Try using su instead of sudo, MEPIS doesn't have sudo enabled by default.
Wayne |
You should type "su" without quotes, hit the enter key and be prompted for your root password. Enter it and enter the command.
|
All times are GMT -5. The time now is 10:56 AM. |