Hi,
Recently I downloaded from the net and unpacked a .zip file to my desktop and it gave two files I can not delete (one is named �����.html and the other is as ugly as the first one). When I try manually, it says : “file:///home/user/Desktop/�����.html doesn’t exist” (same for the other).
As you may have seen in other threads, people here allways want to know which version of openSUSE you use and which desktop (because this is about the desktop, isn’t it?).
And also, allways tell exactly annd precise what you do. Saying “I can not delete” while there are many ways to delete a file contains no information at all for others. Same for “I try manualy”.
Please post the output of
ls -l Desktop
read the caveat in my sig.
-open a user terminal (not root)
-navigate to your desktop with
cd /home/user/Desktop
-enter
ls /home/user/Desktop/?????.html
-you should see ONE file listed (unless the other ugly file also has
five character before the dot), if you do then delete that file with
rm /home/user/Desktop/?????.html
-that should remove it…if it does not, return to here with the error
message…
-then, do the same (ls to check it, and then rm to ReMove it) by using
the same number of ???s as the file to be removed…
CAREFUL, rm is a powerful command and you can wreck your system by
accidentally typing other things, like these are like little bombs “*”
Hi,
Thank you for your help, and sorry about not telling about my OS version and desktop (I’m used to have it in signature - should be down there now).
I tried deleting with the right clic and delete, with Alt Del, and that’s it.
Now I did the ls -l command and found my 2 ugly files :
-rw-r--r-- 1 franck users 403 25 déc. 2011 ?????.html
-rw-r--r-- 1 franck users 201 7 mai 2012 ?祡???? 2012-2013.html
Then I did the command dd advices me :
rm ?????.html
Worked well, but not for the second VERY ugly file (I translated myself the answers from french):
ls ?祡???? 2012-2013.html
ls: impossible to access ?祡????: no such file or directory
ls: impossible to access 2012-2013.html: no such file or directory
The rm command also understood that there are two items, ?祡??? and 2012-2013.html.
So I tried :
ls '?祡???? 2012-2013.html'
ls: impossible to access ?祡???? 2012-2013.html: no such file or directory
Then I though I’d try the rm :
rm: impossible to remove « ?祡???? 2012-2013.html »: no such file or directory
How bad is that ?
On 12/20/2012 09:06 AM, franck210883 wrote:
> rm: impossible to remove « ?祡??? 2012-2013.html »: no such file or directory
what if you try
rm ???????2012-2013.html
BUT, always try it with ls first (to make sure it finds the correct, and
only ONE file!
the ‘trick’ is to use ONE question mark for each potentially “ugly”
character…in this case maybe there is an “ugly” character
pretending to look like a blank space…and, of course you can see that
“ugly” thing second from left…so this time try it with no spaces and
none of these “祡” (both replaced by “?”)
HINT: don’t use anything other than ascii characters in file or
directory names…yes, i know some other stuff works, but not
always…if you want predictable and always works, limit
file/directory names to ascii
I tried as you did (and many different things) and I came to the solution :
> ls ?????????2012-2013.html
?祡???? 2012-2013.html
I changed the chinese sign by 2 “?”, and the space by 1 “?”. Maybe it is because one has to type two buttons to get this sign, like “ê” in french. Interesting anyways.
Thank you very much for your help and advice !
When there is no other file that ends in 2012-2013.html, you simply do
ls *2012-2013.html
When that display only and only the file you want to delete, repeat the above with rm instead of ls.
HINT: don’t use anything other than ascii characters in file or
directory names…yes, i know some other stuff works, but not
always…if you want predictable and always works, limit
file/directory names to ascii
To me that is old fashioned FUD ;).
There are lots and lost of systems that contain file names in Arabic, Chinese, you name it. Even the word ASCII is something that only old system managers know what it means. It is certainly not in the interest of Linux, to propagate it as a low grade system that would not be able to accomodate the scripts/alphabets that are used by the majority of the world.
That trick would have make me win 30 min of my life
I will know for the future, thank you.
On 12/20/2012 12:06 PM, hcvv wrote:
>
> When there is no other file that ends in 2012-2013.html, you simply do
>
> Code:
> --------------------
> ls *2012-2013.html
> --------------------
>
> When that display only and only the file you want to delete, repeat the
> above with rm instead of ls.
VERY good advice, and easier…
–
dd
Try to learn a bit about Pathname Expansion, use
man bash
and scroll down to the paragraph of that name. There you can see what characters like *, ? and …] can do for you in Pattern Matching.
Also Quoting (also a paragraph name there) using “…”, ‘…’ or \ and knowing about their differences, is very usefull for anybody that wants to manipulate with file names using bash.
In fact using bash (or other many shells) is quite a burden when you do not understand at least these.
On 12/20/2012 12:16 PM, hcvv wrote:
> scripts/alphabets that are used by the majority of the
> world.
some of those thousands of characters work well all of the time, but i
doubt if every character of every lingo will always work well no
matter which machine they land on…and “always” was an important
(and highlighted) caveat in what i wrote…
sure, folks should use what character they want which works for them on
their machine…but when creating and sending/receiving (zip or
whatever) files across languages, or creating directories to be shared
around the earth:
If you wish all folks in all areas to keep smiling–use ascii because
it always works.
–
dd