background

  • Symptom The terminal displays the cannot change locale (UTF-8) problem when using SSH to connect to Linux on a Mac.
  • Copy and paste the command to SSH command line window, the message cannot find the command, check it clearly correct

Analysis of the

The local code set is different from that of the remote machine, so change it to the same one.

The solution

Simply modify the profile of the remote service.

use

 vi /etc/environment
Copy the code

Add the following two lines

LANG=en_US.utf-8
LC_ALL=en_US.utf-8
Copy the code

Use this to take a look

cat /etc/environment
Copy the code

image.png

Open the CLI again.