LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ~ showing up in front of 2 files but I cannot delete them (https://www.linuxquestions.org/questions/linux-server-73/%7E-showing-up-in-front-of-2-files-but-i-cannot-delete-them-656633/)

blckspder 07-18-2008 10:05 AM

~ showing up in front of 2 files but I cannot delete them
 
Hello,

I am running Fedora 8. We have 2 files on the server that one can access. It looks like someone is still in the file, but this is not the case. The files are E05993.slddrw and E05993.sldprt, each file has a file next to it named ~$E05593.slddrw and ~$E05593.sldprt respectively. I believe if I can delete these files people will be able to access the originals again.. but when I use the rm command in terminal to delete the files with ~$ in front of them I get a warning that there are no such files even though I can see them when I run an ls -l command. Please help!

forrestt 07-18-2008 10:14 AM

The '~' and '$' are special characters in the shell. You will need to escape them or do this in a different way. Try the following:

Code:

rm \~\$E05993.slddrw
If that works, do the same for the other file. If it does not, do the following:

Code:

mkdir temp1234
mv *E05993.slddrw temp1234
mv *E05993.sldprt temp1234
mv temp1234/E05993.slddrw .
mv temp1234/E05993.sldprt .

Make sure the files you want to keep are still in the original directory and the files you want to delete are in temp1234. If they are, run:

Code:

rm -rf temp1234
HTH

Forrest

blckspder 07-18-2008 10:33 AM

I tried escaping the files like you suggested and that didn't work. However your second selection did work. I moved the files as you described and then deleted the folder. Worked like a charm! Thanks for your help.

kardster 07-18-2008 10:47 AM

You could also use interactive mode to select which files to actually delete:
Code:

rm -i *E05993*


All times are GMT -5. The time now is 05:14 PM.