I have the following folders on a CentOS 7 Droplet. They were added via FTP from a French operating system.

  • Evénement 1
  • Evénement 2
  • Evénement 3

The accented character (é) is replaced with a question mark when I do ls.

I cannot cd into these folders.

I have tried several suggestions from around the web without luck. Including:

cd Evénement\ 1
cd "Evénement 1"
cd "Ev?nement 1" (copying the exact output from ls)
cd Ev\nement\ 1
cd Ev\énement\ 1
cd Ev\351énement\ 1 (because ls -b outputs them like that)

Here is the output of locale.


Thanks in advance for any help.

  • try temporary set LANG=fr_CA.UTF-8 – mmv-ru Mar 18 '17 at 23:06

use single quotes and/or tab (autocomplete), like following:

mbp:~ alexus$ mkdir 'Evénement'
mbp:~ alexus$ cd 'Evénement'
mbp:Evénement alexus$ pwd
mbp:Evénement alexus$ cd ..
mbp:~ alexus$ cd Evénement/
mbp:Evénement alexus$ 
  • Thanks. When I make a new directory via the command line it works well as it does for you. But these are all files that were added via FTP and that seems to have caused the issue since I can't get into them via command line. – Greg Mar 18 '17 at 22:42
  • @ScreenWatcher You really tried tab autocompletion? – mmv-ru Mar 18 '17 at 23:04
  • @screenwatcher yes, second try was with tab. – alexus Mar 18 '17 at 23:06
  • When I try tab autocompletion, it finds several folders with the same start to the filename, so doesn't autocomplete. I can hit tab twice to see the proposed names. Is there a way for me to autocomplete with one of those proposed names? – Greg Mar 21 '17 at 14:56
  • @ScreenWatcher Type Ev then hit tab) – alexus Mar 21 '17 at 14:59

Try cd "Ev*nement 1". cd "Ev?nement 1" (typing the ? yourself instead of copying it from the shell's output) may also work. My guess is that the question mark in the ls output is not a real question mark but rather a special character indicating the shell's failure to decode the character.

Can you post the output of locale?

  • Thanks, I tried those suggestions without success. I have added the output of locale to my original post. – Greg Mar 18 '17 at 22:42

I found a solution to this issue. I changed the character encoding from Unicode (UTF-8) to Western (ISO Latin 1) for my actual terminal program, iTerm2. I did this my modifying the profile that connects to this server as follows:

iTerm2 > Preferences > Profiles > Profile > Terminal > Character encoding

Now the accented characters show correctly and I can cd into them without trouble.

Thanks again to those who tried to help.

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.