LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2017, 11:04 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post 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.
 
Old 08-20-2017, 11:07 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,214
Blog Entries: 20

Rep: Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759
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.
 
Old 08-23-2017, 02:01 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
what if that command is a shell builtin?
maybe something like
Code:
LC_ALL=some.lang bash -c mkdir ...
is required?
 
Old 08-23-2017, 02:13 PM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Distribution: Mint/MATE
Posts: 3,027

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Even simpler
Code:
LC_ALL=some.lang mkdir ...
In a tcsh you need /usr/bin/env
Code:
env LC_ALL=some.lang mkdir ...
 
Old 08-23-2017, 02:24 PM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,214
Blog Entries: 20

Rep: Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759
Quote:
Originally Posted by ondoho View Post
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.
 
Old 08-26-2017, 08:32 AM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by MadeInGermany View Post
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?
 
Old 08-26-2017, 09:17 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,214
Blog Entries: 20

Rep: Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759Reputation: 4759
Quote:
Originally Posted by hack3rcon View Post
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.
 
Old 08-26-2017, 10:57 AM   #8
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,228

Rep: Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345Reputation: 2345
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!
 
Old 08-26-2017, 01:34 PM   #9
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How could a computer technician use the "top" command with "ps" and "kill" to investigate how a system is misbehaving? geckono1 Linux - Newbie 13 07-03-2016 07:51 AM
[SOLVED] how to simulate "mkdir -p /home/blah1/blah2/blah3" in "c" where only /home exist platinumedge Linux - Newbie 4 10-04-2009 06:28 PM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 12:30 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
C/C++ functions similar to BASH's "cp", "mv", "mkdir", etc? kornerr Programming 10 04-23-2006 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration