Click to See Complete Forum and Search --> : how to delete file "?e??!?????"


bkhkote
07-27-2009, 11:17 AM
I had an accidental program execution that generated some junk files and I am not sure
how to delete them.

Ũ?e??!?????
{?R0?q?
???Q?P???b?
??????f????


>rm "\?\?\?\?\?\?f\?\?\?\?"
rm: cannot lstat `\\?\\?\\?\\?\\?\\?f\\?\\?\\?\\?': No such file or directory

Thanks in advance.

stumbles
07-27-2009, 11:24 AM
Try double quoting the filename;

rm /path/to/file/"junk_name"

bkhkote
07-27-2009, 02:08 PM
>rm /users/xyz/"???Q?P???b?"
rm: cannot lstat `/users/xyz/???Q?P???b?': No such file or directory

irlandes
07-27-2009, 03:19 PM
If you can't get it from the command line, it sure isn't likely to be do-able from the file manager GUI, but I suppose you could try it.

Also, run the file manager GUI from su or sudo just to avoid permissions problems.

gamblor01
07-27-2009, 03:34 PM
what if you grep out all of the stuff that you want to keep and then try xargs rm? For example, let's say all you have in this directory are mp3 files, you could do something like:


ls | grep -v ".mp3" | xargs rm


I would strongly recommend you run the command without piping into xargs first and make sure that it's ONLY listing the files that you want to be deleted. If it's listing something else you want to keep, pipe it into another grep -v before piping into xargs.

bwkaz
07-28-2009, 12:50 AM
Before you assume that the ? characters that ls is showing you are actually ? characters in the filename, try these out:

ls --quoting-style=escape
ls --quoting-style=c
ls --quoting-style=shell
ls --quoting-style=literal

(The last one might destroy your terminal instance, depending on what actual bytes are being printed. Exit the terminal you're in and start another one if this happens.)

If you get anything other than question marks in these spaces for the "escape", "c", or "literal" quoting styles, then you need to pass these files to rm directly -- don't escape the question marks:

echo ??????f????

(Make sure only one file is echo'd there, so you aren't matching several files that all have a single "f" in this position in their names. If that's true, then continue.)

rm ??????f????

Alternately, you can use tab completion if you can type in the first character of any of these filenames. Do:

rm X

and then hit tab. (Where "X" is replaced by the first character of the filename.) The shell will autocomplete as much of the filename as it can, then stop; hitting tab a couple of times in quick succession when this happens will list all the options. You'll need to type in the next character yourself, and hit tab again to keep on completing. Once the shell has completed the entire filename, it'll add a space to the end; hitting return at that point should remove the file.

blackbelt_jones
07-28-2009, 08:27 AM
If it were me, I'd be looking for a solution involving wildcards. I don't know what other files are in the directory with your junk files, but if you could temporarily remove all the other files from the directroy , you could then try

rm *Q*q*

or even

rm *

with impunity.

ph34r
07-28-2009, 10:25 AM
rm \?e\?*

deathadder
07-28-2009, 11:00 AM
http://www.justlinux.com/forum/showthread.php?t=152334

furrycat
07-28-2009, 11:00 AM
Come on guys you know the answer to this...$ ls -li
total 0
743957832 -rw-r--r-- 1 furrycat furrycat 0 2009-07-28 10:58 Ũ?e??!?????
$ find . -inum 743957832 -exec rm {} \;
$ ls -li
total 0

deathadder
07-28-2009, 11:07 AM
That's what I said ;)

JohnT
07-29-2009, 02:00 AM
I have run into this situation numerous times with files I get from Japan or Korea. A simple rename and then "rm" does it for me.

Sepero
08-04-2009, 02:17 AM
I've never had a problem deleting files like this with Nautilus.

mmills
08-13-2009, 06:16 PM
some linux distros like "sabayon" require you to

su
password
rm /file/path

hope this helps.....PS im posting this with Internet Explorer (ack) wifes pc