I found something weird
Sometimes, when I type commands in the terminal (Konsole) some weird characters appear. I decided to ignore that and kept writing commands until I typed something like this :
mkdir Test�Dir
Now, I see that there is a weird character in there, but it wasn't visible then. When I executed the command, it gave me some error but it created a folder anyway with some files in it (I was testing an automation program that was supposed to put files in it). I decided to delete that folder and recreate one, without the weird character this time, but Dolphin told me that there was no such folder and didn't delete anything. But when I try to open it there are still files and subfolders in it.
Does anyone know how to fix this ?
About this post
- Posted
- Archived
- Score
- 0 · 100% up
- Kind
- Text
- ID
- dieqlv
12 comments
In case you copy+pasted that from your terminal, I believe you are having there
efbfddefbfbd character. How I found out, you might ask? Time to learn a bit about a certain tool called xxd (comes with vim). What I did was this:efbfbd seems to be something called "Replacement Character". I have no idea what that is, except with a quick Google search I came up with https://apps.timwhitlock.info/unicode/inspect?s=%EF%BF%BD#block-UFFF0 and https://blog.gdssecurity.com/labs/2015/2/18/when-efbfbd-and-friends-come-knocking-observations-of-byte-a.html . The latter one seems to have some explanation, however I didn't read/understand it properly (yet, I will if I have time).
FWIW if I re-created that folder and use tab-completion, I can remove the dir just fine. What happend if you type "rmdir T" and then hit tab? If nothing, then how about "ls -l T*" ?
One thing which has been bugging me is non-breaking space. But on my keyboard layout, it is mapped to ALT Gr+Space. If it is also mapped to Shift+Space, you could get that also. It is indistinguishable in all fonts and useless in a terminal, so it makes sense to disable it (as I'd often hit Alt Gr + Space while using pipes, for example - and here you could have hit it because the folder starts with a capital letter). However, it should not produce weird characters as in your case. Maybe you have escaped it, and the shell then does (or did) funny things with it?
EDIT: If you still get funny characters in terminal, it is worthwhile to try to see if you can reproduce them at will. That way, it might be possible to find out what is actually wrong and fix the root cause.
Thanks for your advice ! That weird character appears sometimes when I type something with a capital letter in it so that may be the root cause of it. The weirdest thing is that these characters only appear when I execute the command, I have no way to know when I type it advance
So, do they always precede the capital letter?
What would indeed explain it: you sometimes accidentally press shift+space, and shift+space is bound to something else than regular space. It might be re-interpreted to something else by your shell only after you execute the command. Try to disable non-breaking space - there are many ways to do this.
Otherwise, you really need to give more information - for example, examples when does the situation actually occur. Otherwise it is just guesswork for anyone here.
hmm. How about typing rm -rf T, then hit tab to do a completion. it should try to fill in the name including your weird character?
I tried but it doesn't go away
Is this this \303 character? I had that a bunch of times, interestingly enough not only on a PC but also when using an Android terminal emulator. Its always the same character, no idea where it comes from.
Yes it is
This can happen for a number of reasons, #1 being trying to
cator print binary file. When you see this, typeresetin terminalThe easiest way to remove a file with weird name is to use
findwith-delete.I happens right after I open the terminal and very often, and I never cat a bin file. And I can't remove the folder with find (at least I don't know how to)