WEBVTT

00:01.070 --> 00:08.900
To get the most from your Linux system, you need to understand environment variables and be adept adept

00:08.900 --> 00:13.430
at managing them for optimal performance, convenience and even stealth.

00:13.940 --> 00:19.730
So among the areas that the Linux newcomers find problematic, however, managing the user environment

00:19.730 --> 00:23.060
variables might be the most difficult to master.

00:23.600 --> 00:25.940
So technically, there are two types of variables.

00:26.600 --> 00:29.960
The first is shell, and the second is environment.

00:30.800 --> 00:37.010
So environment variables are system wide variables built into your system and interface that control

00:37.010 --> 00:44.840
the way your system looks, acts and feels the to the user and they are inherited by end charge shills

00:44.840 --> 00:45.710
or processors.

00:46.730 --> 00:54.500
Social variables, on the other hand, are typically listed listed in lowercase and are only valid in

00:54.500 --> 00:55.220
their shell.

00:55.250 --> 00:56.480
They are set in.

00:57.140 --> 01:04.130
So to avoid over explanation, I just, uh, cover some of the most basic and useful skills for environment

01:04.130 --> 01:10.460
and shell variables in this lectures and don't go too deeply into the differences between them.

01:11.240 --> 01:15.890
So variables are simple strings in key value pairs.

01:16.460 --> 01:28.100
So again, or generally, each pair will look like this, for example, key and value key here and add

01:28.100 --> 01:28.940
value here.

01:29.750 --> 01:30.200
So.

01:32.520 --> 01:42.750
In cases where there are multiple values, they will look like this is a value one value to and value

01:42.760 --> 01:44.610
three and vice versa here.

01:45.450 --> 01:53.790
So as with most things in Linux, if there are spaces in the value, it needs to be contained in a quotation

01:53.790 --> 01:54.870
marks here.

01:56.710 --> 01:57.410
Like that?

01:58.800 --> 02:00.290
While the fourth.

02:02.720 --> 02:03.140
So.

02:08.140 --> 02:12.640
So in in your environment, in your shell is your best shell.

02:12.910 --> 02:19.540
So each user, including ruled, has a different set of environment variables that determine how the

02:19.540 --> 02:21.280
system looks, acts and.

02:22.060 --> 02:28.570
So you can change the values for these variables to make your system work more efficiently.

02:28.810 --> 02:33.970
Tailor your work environment to best meet your individual needs and potentially cover your tracks if

02:33.970 --> 02:34.660
you need to.

02:35.740 --> 02:42.100
So leaving and modifying environment variables so you can be while your default environment variables

02:42.100 --> 02:49.060
by entering any V into your terminal from any directory like so here.

02:49.960 --> 02:54.010
So as you can see, there is a light environment variables here.

02:57.660 --> 03:03.660
So environment variables are always upper case, as you can see here.

03:05.190 --> 03:12.570
So, including shell variables, local variables and show functions such as any user defined variables

03:12.570 --> 03:20.050
and command aliases, some use a set common this command will list all environment variables.

03:20.520 --> 03:28.410
Um, on environment variables unique to your system, which is the most cases will give you an output

03:28.410 --> 03:33.660
so long you won't be able to view it, uh, on a single screen here.

03:34.230 --> 03:35.430
So you can see here.

03:36.360 --> 03:40.410
We have so many environment variables here.

03:43.680 --> 03:51.660
As you can see here, we can see, because it's so many here, so, uh, we can do like that, sit here.

03:52.620 --> 03:53.070
Said.

03:54.260 --> 03:55.880
And more here.

03:57.220 --> 04:00.100
Now we can see like that by pressing enter.

04:00.430 --> 04:02.040
We can see a sequential.

04:02.400 --> 04:10.990
So let's see more more and, uh, press in one time control and save or exit or quit here.

04:11.980 --> 04:17.740
So now the last three of us here, as you can see here, feel, uh, will fill up on a screen line by

04:17.740 --> 04:18.880
line and then stop.

04:19.330 --> 04:26.940
Uh, when you press enter like that, uh, or space or, uh, spin in space and you will see more here.

04:28.160 --> 04:36.020
Uh, so, uh, taking you to the next variable so you can scroll through pressing or holding, enter

04:36.020 --> 04:36.560
like that.

04:37.190 --> 04:37.580
So.

04:39.490 --> 04:46.990
As you might recall, from previous chapters and elections, whenever you you use, the more common

04:46.990 --> 04:59.380
for output you can enter key it to or exit and return command to like that or control plus easier.

05:00.190 --> 05:03.490
So filtering for particular variables?

05:03.910 --> 05:06.160
Let me, uh, see here.

05:06.170 --> 05:14.440
So, uh, I'll talk to you using sent, uh, with more gifts, more, uh, manageable results than working

05:14.440 --> 05:20.950
through the whole chunk of variable names you get with this sit along like that.

05:22.030 --> 05:23.020
Uh, so.

05:24.740 --> 05:28.580
It can still be a rather tedious if you are looking for a particular variable.

05:28.880 --> 05:35.540
Instead, you can use the filtering command grant, um to find your variable of interest.

05:35.960 --> 05:39.350
So let's use the variable his size as an example.

05:39.770 --> 05:46.070
So this variable contains his size on this variable contains the maximum number of comments you were.

05:46.070 --> 05:48.470
Common history of a file was stored.

05:49.190 --> 05:58.310
So his size is the maximum and number of commands your command history file will start to his commands

05:58.550 --> 06:06.070
or any was previously typed into your command prompt in the session and can be recalled with your up

06:06.080 --> 06:10.760
here, up and down, uh, keywords like that.

06:13.440 --> 06:19.710
So you're not at his size, doesn't store the comments themselves, just a number of them that can be

06:19.720 --> 06:29.580
stored so popular, sit here said, Oh crap, actually cramp his size.

06:29.970 --> 06:30.300
Yeah.

06:30.980 --> 06:33.870
Well, as you can see, his size is 1000.

06:34.200 --> 06:39.840
As you can see, the common finds the variable, his size, and this place is its value.

06:40.230 --> 06:45.570
The default value of this variable is probably set to one thousand here, as you can see on your system,

06:45.570 --> 06:45.900
too.

06:46.230 --> 06:52.080
So this indicates the terminal this storage would last 1000 commands by default.
