How do I unlock a file?
I want to throw away some files I donwloaded but I can't because some are locked.
How do I unlock them? Thanks. |
First make sure that no other programs are using them (close the ones that are). Then try to delete. If your are sure nothings using the files, go to /var/lock, and delete the lock file for the file you want to delete.
Edit: use 'lsof' to list open files. |
hi,
you have to change the permissions of these files using chmod or you delete this files as root ;-) [Mn3moniC] |
You wrote . . .
you have to change the permissions of these files using chmod or you delete this files as root ;-) 1. How do you change permissions? Step by step please. 2. How do you delete files as root? I know how to become the su. You wrote . . First make sure that no other programs are using them (close the ones that are). Then try to delete. If your are sure nothings using the files, go to /var/lock, and delete the lock file for the file you want to delete. Edit: use 'lsof' to list open files. 1. What do you mean "go to /var/lock"? 2. How do I delete the file when I get there? Thanks for the replies! |
Quote:
1) To change the permissions, use "chmod" from the root (su) prompt. 2) "rm /directory/where/file/is/filename.ext 3) "cd /var/lock" 4) "rm filename" (This assumes you're in the folder/directory where the file is) But I think you just want to do the following: 1) Get to a prompt 2) su yourself 3) "cd /whereever/the/file/is" 4) "rm filename.ext" As root, you can pretty much do anything you want. The commands you want to look into are "chmod" (which changes read/write permissions), "chown" (which changes the owner of the file), "rm" (which deletes files/directories), and "cd" (change directory) :-D You can always "man COMMAND" to see the help file, or google it to see what people wrote online. "chmod" settings can be a bit tricky at first....Here's a web link to help you out (http://wsabstract.com/script/script2/chmodcal.shtml) And of course you could just be lazy and ask in a forum over here. ;-) Turner |
Okay - from the top. Here are step-by-step examples.
I do not know any of the names of your file - use a pretend one - /path/to/problemfile 1. change permissions on protected file Code:
su - 2. use lsof Code:
su - It has all the names of locked files and what process has those files locked. -- Based on your responses I hope this is your home machine. If it's a box at work, you should get a LOT of training before somebody gives you su access. :D |
Turner/Jim,
Thanks for all the help. The files are gone and the info is on record. Brooks |
Less known thing about UNIX is that locks are voluntary. Programs may or may not respect the locks set on files. FOr that reason, You can edit, copy, remove, rename, move a file if you have permissions to do so. If you really want to delete that file than use rm -f for forcing the remove.
|
Quote:
|
All times are GMT -5. The time now is 02:51 AM. |