Skip to content

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 ?

0 points12 comments
Open on Reddit
About this post
Posted
Archived
Score
0 · 100% up
Kind
Text
ID
dieqlv

Author

11
posts
49
comments
7
media
View profile

12 comments

In case you copy+pasted that from your terminal, I believe you are having there efbfdd efbfbd 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:

$ echo Test�Dir | xxd
00000000: 5465 7374 efbf bd44 6972 0a              Test...Dir.

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.

1 points

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

1 points

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.

2 points

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?

1 points

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.

1 points

when I type commands in the terminal (Konsole) some weird characters appear.

This can happen for a number of reasons, #1 being trying to cat or print binary file. When you see this, type reset in terminal

The easiest way to remove a file with weird name is to use find with -delete.

0 points

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)

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.