Linux – Can’t cd into a directory named with accented characters

bashcharsetcommand-line-interfacelinux

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.

LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=

Thanks in advance for any help.

Best Answer

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

mbp:~ alexus$ mkdir 'Evénement'
mbp:~ alexus$ cd 'Evénement'
mbp:Evénement alexus$ pwd
/Users/alexus/Evénement
mbp:Evénement alexus$ cd ..
mbp:~ alexus$ cd Evénement/
mbp:Evénement alexus$