Environment Variables and Character Sets

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey, Cybrarians. Welcome back to
00:00
the Linux plus course here at Cybrary,
00:00
I'm your instructor Rob Gyles.
00:00
In today's lesson,
00:00
we're going to be discussing environmental variables
00:00
and character sets.
00:00
Upon completion of today's lesson,
00:00
you're going to be able to describe
00:00
the environmental variables that are
00:00
covered on the Linux plus exam,
00:00
and differentiate between
00:00
the different types of character sets.
00:00
There are a number of different
00:00
environmental variables in Linux and
00:00
we'll come back to some of these in
00:00
later modules in this course.
00:00
But in this lesson, we're just going to talk about
00:00
the environmental variables that
00:00
are related to localization.
00:00
Now the LANG environmental variable controls
00:00
all environmental variables.
00:00
It can only be overridden by
00:00
the LC_ALL variables that
00:00
we'll cover here in a couple of seconds.
00:00
Generally, this is where we set
00:00
the English language or
00:00
any other language that we're using;
00:00
LANG equals en_US.UTF-8 or UTF-8,
00:00
and that indicates that we're using US English
00:00
with a UTF-8 character set.
00:00
We'll talk about character sets
00:00
>> here in a minute as well.
00:00
>> The LC underscore character variables
00:00
or category variables are
00:00
used to define or modify a specific locale category.
00:00
You can see some of those over here on the right.
00:00
A couple of examples of this would be LC time,
00:00
how the time is
00:00
formatted for the different locale you're in.
00:00
It is generally in 12 hours or 24 hour time,
00:00
and the monetary unit and format for the locale.
00:00
Are we in the US and we're we using dollars?
00:00
Are we over in Britain and we're using pounds?
00:00
Are we in Europe and we're using the Euro?
00:00
Those things get configured in that variable.
00:00
The LC_ALL, as I said,
00:00
overrides everything
00:00
including the language and we can use
00:00
the locale command to see
00:00
all of these different LC variables.
00:00
We see that over on the right-hand side,
00:00
I've taken a screenshot of
00:00
the locale command run on an Ubuntu system.
00:00
Now the TZ variable is
00:00
used to set the default time zone,
00:00
TZ for time zone.
00:00
Easy to remember. That is
00:00
something we're going to talk about later
00:00
>> in this module.
00:00
>> We're going to use commands to modify the time zone.
00:00
But right now, just remember TZ is
00:00
the variable that contains the time zone.
00:00
Now character sets define how characters in
00:00
a language appear in
00:00
a Linux system and how they're interpreted.
00:00
There's three we're going to talk about.
00:00
The first one is ASCII or
00:00
American Standard Code for Information Interchange.
00:00
This has been around a long time.
00:00
You've probably seen some ASCII
00:00
out there on the Internet.
00:00
What it does is it stores English language in 7-bits.
00:00
Now it's rapidly becoming replaced by UTF-8,
00:00
which is Unicode Transformation Format 1-byte.
00:00
UTF-8 because it's one bit more than 7-bits, so UTF-8.
00:00
In English-speaking countries,
00:00
>> UTF-8 is replacing ASCII.
00:00
>> Now, Unicode is what's used elsewhere and
00:00
everywhere in the world because it uses a 3-byte code,
00:00
so three times as long as UTF-8.
00:00
That represents every character
00:00
used in all countries in the world.
00:00
In this lesson, we covered
00:00
environmental variables that are used for localization,
00:00
that could be LANG or the LC categories,
00:00
LCL, and the time zone or TZ variable.
00:00
We also talked about three character sets,
00:00
ASCII, UTF-8, and Unicode.
00:00
Thank you so much for being here and I look
00:00
forward to seeing you in our next lesson.
Up Next