2

I have a lot of directories with a \uFFFD (65533) character in it. The problem is that I can't really access this directory because of this character.

For example I got a directory with the name: Foo�o (� == \uFFFD)

  1. ls Foo�o is not working (so tab is always showing the only possible file but it will never complete it 'cause it's not working)
  2. ls Foo* is working

The problem is that I can't use the 2. way because there might be other directories starting with the same characters. So the actual question is if there's a way to escape a character like this.

So I'm searching for a working version of this: ls Foo\uFFFDo <= not working

5
  • 2
    What terminal are you using? Is it unicode capable? are you using GNU screen? I've just tried duplicating your problem in my terminal (roxterm) and had no problem creating, using, cd-ing, deleting, etc files and directories with unicode characters in them.
    – cas
    Sep 15, 2013 at 3:12
  • That's a unicode character, I think you're going to have a bigger problem on your hands than you think. fileformat.info/info/unicode/char/fffd/index.htm
    – slm
    Sep 15, 2013 at 3:15
  • @CraigSanders I'm using the normal gnome-terminal
    – noob
    Sep 15, 2013 at 3:18
  • Try using single-quotes around the filename. e.g. ls 'Foo�o'
    – cas
    Sep 15, 2013 at 3:19
  • 3
    I would suggest giving a try to what mattdm suggested in this U&L Q&A: unix.stackexchange.com/questions/8859/…
    – slm
    Sep 15, 2013 at 3:22

2 Answers 2

1

You need to escape the character properly depending on the shell you are using if you can't/don't want to rely internal completion. For example in Bash, the correct way to escape it would be:

$ ls $'Foo\uFFFDo'
Foo�o

See section on quoting in your shell's man page.

3
  • Thanks but this is not working for me.
    – noob
    Sep 16, 2013 at 20:38
  • What shell are you using? Are you sure it is the 0xFFFD character and not something else with similar glyph?
    – peterph
    Sep 16, 2013 at 20:58
  • @mic What do you mean by “not working”? Copy-paste the command you ran and the error message, as well as the output of LC_ALL=C ls -b. Edit your question. Sep 16, 2013 at 23:43
0

Try running the command:

$ find Foo* -ls
1
  • This is the other problem, the find command will not output the real name. For Example �%93 will get an Ö but I can't access the directory with that name.
    – noob
    Sep 15, 2013 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .