LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   MEPIS (https://www.linuxquestions.org/questions/mepis-64/)
-   -   How to Unlock a file? (https://www.linuxquestions.org/questions/mepis-64/how-to-unlock-a-file-440497/)

limeylew 05-01-2006 06:02 AM

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.

****

bernied 05-01-2006 09:07 AM

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
ls

Is it there? You can use
Code:

pwd
to find out where you are in the directory structure.

Once you're in the right place (ie, when you type ls, the file is listed):
Code:

chown user file
where user is your login name, and file is the name of the file.

Have a google at 'linux permissions'

And, in a console, try
Code:

man cd
or man followed by any of the other commands you've just used. Look for a basic linux guide - you will learn lots very fast.

limeylew 05-01-2006 04:00 PM

Re: How to unlock a file?
 
Quote:

Originally Posted by bernied
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
ls

Is it there? You can use
Code:

pwd
to find out where you are in the directory structure.

Once you're in the right place (ie, when you type ls, the file is listed):
Code:

chown user file
where user is your login name, and file is the name of the file.

Have a google at 'linux permissions'

And, in a console, try
Code:

man cd
or man followed by any of the other commands you've just used. Look for a basic linux guide - you will learn lots very fast.

Thanks you very much for a great reply.

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.

*****

Emerson 05-01-2006 04:07 PM

No response = action successful.

bernied 05-02-2006 04:04 AM

Sorry, i left something out.
Try:
Code:

sudo chown user file
sudo is do as super user
or, if you just want the file gone
Code:

sudo rm file
The Ubuntu guides have a lot to say about sudo:
https://wiki.ubuntu.com/RootSudo

limeylew 05-02-2006 05:31 AM

Re: How to unlock a file?
 
Quote:

Originally Posted by Emerson
No response = action successful.

Thanks, you are absolutely right.

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.

*****

limeylew 05-02-2006 05:48 AM

Re: How to unlock a file?
 
Quote:

Originally Posted by bernied
Sorry, i left something out.
Try:
Code:

sudo chown user file
sudo is do as super user
or, if you just want the file gone
Code:

sudo rm file
The Ubuntu guides have a lot to say about sudo:
https://wiki.ubuntu.com/RootSudo

Thanks again, I think I'm on a roll now. :-)

Kind regards.

Lewis.

*****

Evailya 06-16-2010 09:14 PM

Failed for me need help
 
Quote:

Originally Posted by bernied (Post 2225663)
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
ls

Is it there? You can use
Code:

pwd
to find out where you are in the directory structure.

Once you're in the right place (ie, when you type ls, the file is listed):
Code:

chown user file
where user is your login name, and file is the name of the file.

Have a google at 'linux permissions'

And, in a console, try
Code:

man cd
or man followed by any of the other commands you've just used. Look for a basic linux guide - you will learn lots very fast.

I followed all of the step when i type ls the file is listed but when i try to do the rest of it 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': 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

yancek 06-16-2010 11:07 PM

You have spaces in the filename so use double quotes:

evailya@evailya-laptop:~/Desktop$ chown evailya "World of Warcraft"

Evailya 06-17-2010 12:40 AM

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

djsmiley2k 06-17-2010 10:10 AM

Evailya:

Can you paste the output of
Code:

ls -la
and we can see what permissions etc the file has created with. Also as someone else said, you made need to run the "chown" as root.

Code:

sudo chown ....
Have fun :)

yancek 06-17-2010 10:14 AM

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.

Evailya 06-18-2010 12:48 PM

Quote:

Originally Posted by djsmiley2k (Post 4006625)
Evailya:

Can you paste the output of
Code:

ls -la
and we can see what permissions etc the file has created with. Also as someone else said, you made need to run the "chown" as root.

Code:

sudo chown ....
Have fun :)

Here is what you asked for

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

wcc1776 06-18-2010 12:50 PM

Try using su instead of sudo, MEPIS doesn't have sudo enabled by default.

Wayne

yancek 06-18-2010 12:53 PM

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.