LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change language in "mkdir" command. (https://www.linuxquestions.org/questions/linux-newbie-8/change-language-in-mkdir-command-4175612299/)

hack3rcon 08-20-2017 12:04 PM

change language in "mkdir" command.
 
Hello.
If I want to create a directory in other language with "mkdir" command then how can I change my language? For example, create a directory in chinese language.


Thank you.

hazel 08-20-2017 12:07 PM

You can set the environmental variable LC_ALL to anything you like. If you set it at the beginning of a command line, it will apply to that command only.

ondoho 08-23-2017 03:01 PM

what if that command is a shell builtin?
maybe something like
Code:

LC_ALL=some.lang bash -c mkdir ...
is required?

MadeInGermany 08-23-2017 03:13 PM

Even simpler
Code:

LC_ALL=some.lang mkdir ...
In a tcsh you need /usr/bin/env
Code:

env LC_ALL=some.lang mkdir ...

hazel 08-23-2017 03:24 PM

Quote:

Originally Posted by ondoho (Post 5751365)
what if that command is a shell builtin?
maybe something like
Code:

LC_ALL=some.lang bash -c mkdir ...
is required?

mkdir is a command.Try type mkdir and you'll see.

hack3rcon 08-26-2017 09:32 AM

Quote:

Originally Posted by MadeInGermany (Post 5751370)
Even simpler
Code:

LC_ALL=some.lang mkdir ...
In a tcsh you need /usr/bin/env
Code:

env LC_ALL=some.lang mkdir ...

Can you show me an example? when I use "LC_ALL=ch" then everything that I have write after "mkdir" command is in china language automatically?

hazel 08-26-2017 10:17 AM

Quote:

Originally Posted by hack3rcon (Post 5752155)
Can you show me an example? when I use "LC_ALL=ch" then everything that I have write after "mkdir" command is in china language automatically?

I think China is zh, not ch. The codes are always in the national language.

DavidMcCann 08-26-2017 11:57 AM

You don't need to alter the locale: mkdir will accept any name you give it. All you need is to have set up Chinese keyboard support.

As an example, I've just
1. opened a terminal
2. typed "mkdir "
3. switched to a Greek keyboard
4. typed "μακαρια" <ENTER>
and I've got a directory called μακαρια. Simple!

KenJackson 08-26-2017 02:34 PM

Here's another way. If you have xclip installed you can find the name you want to use, for example on any website, and copy it to the clipboard. Then use the xclip command to retrieve it when you make your directory like this:
Code:

mkdir $(xclip -sel clip -o)


All times are GMT -5. The time now is 08:20 PM.