LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 12:04 PM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 10
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, 12:07 PM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 3,946
Blog Entries: 11

Rep: Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176
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, 03:01 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,229
Blog Entries: 9

Rep: Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618Reputation: 3618
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, 03:13 PM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,268

Rep: Reputation: 580Reputation: 580Reputation: 580Reputation: 580Reputation: 580Reputation: 580
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, 03:24 PM   #5
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 3,946
Blog Entries: 11

Rep: Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176
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, 09:32 AM   #6
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 10
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, 10:17 AM   #7
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 3,946
Blog Entries: 11

Rep: Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176Reputation: 2176
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, 11:57 AM   #8
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,412

Rep: Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883Reputation: 1883
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, 02:34 PM   #9
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 755

Rep: Reputation: 144Reputation: 144
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 08: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 07:28 PM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 01:30 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
C/C++ functions similar to BASH's "cp", "mv", "mkdir", etc? kornerr Programming 10 04-23-2006 10:48 AM

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

All times are GMT -5. The time now is 05:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration