33

The following picture is snapped in a real Linux environment.

ls output showing characters similar to forward-slash (/) in a filename

Why can Linux show a file name containing character '/'?

  • 7
    So what character is it? Please update your question with the hexdump output. – cjm Sep 5 '14 at 5:09
  • 1
    Even if all APIs enforce filename character restrictions on write, it could be possible (but unwieldy) to edit the filename directly in the disk image. (I do not know if today's usual filesystems check filenames on read.) – Ulrich Schwarz Sep 5 '14 at 6:52
  • @cjm,I have reverted the snapshot of vmware. – xmllmx Sep 5 '14 at 9:33
  • 5
    @xmllmx: That's one of the reasons why rather than (or in addition to) a picture, it's best to copy and paste the output as text. – T.J. Crowder Sep 6 '14 at 7:16
  • 2
    Ext* only bans two chars from filenames: \0 and /. This is a kernel- and FS-level limitation; even if you managed to do it by mucking around with directory entries yourself, i'm about 82% certain Linux wouldn't be able to navigate to the file to open it. – cHao Sep 6 '14 at 16:01
54

It's not a / character (U+002F); it's some Unicode character that just looks similar.

Try

ls | hexdump -C

to see what it is.

Some possibilities are FRACTION SLASH (U+2044), DIVISION SLASH (U+2215), MATHEMATICAL RISING DIAGONAL (U+27CB), and the combining solidus characters U+0337 and U+0338, but there's no way to tell which one from your screenshot.

  • 2
    cool...thanks, that ls | hexdump -C seems to be useful in a number of cases. – beginer Sep 5 '14 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.