1
00:00:01,070 --> 00:00:08,900
To get the most from your Linux system, you need to understand environment variables and be adept adept

2
00:00:08,900 --> 00:00:13,430
at managing them for optimal performance, convenience and even stealth.

3
00:00:13,940 --> 00:00:19,730
So among the areas that the Linux newcomers find problematic, however, managing the user environment

4
00:00:19,730 --> 00:00:23,060
variables might be the most difficult to master.

5
00:00:23,600 --> 00:00:25,940
So technically, there are two types of variables.

6
00:00:26,600 --> 00:00:29,960
The first is shell, and the second is environment.

7
00:00:30,800 --> 00:00:37,010
So environment variables are system wide variables built into your system and interface that control

8
00:00:37,010 --> 00:00:44,840
the way your system looks, acts and feels the to the user and they are inherited by end charge shills

9
00:00:44,840 --> 00:00:45,710
or processors.

10
00:00:46,730 --> 00:00:54,500
Social variables, on the other hand, are typically listed listed in lowercase and are only valid in

11
00:00:54,500 --> 00:00:55,220
their shell.

12
00:00:55,250 --> 00:00:56,480
They are set in.

13
00:00:57,140 --> 00:01:04,130
So to avoid over explanation, I just, uh, cover some of the most basic and useful skills for environment

14
00:01:04,130 --> 00:01:10,460
and shell variables in this lectures and don't go too deeply into the differences between them.

15
00:01:11,240 --> 00:01:15,890
So variables are simple strings in key value pairs.

16
00:01:16,460 --> 00:01:28,100
So again, or generally, each pair will look like this, for example, key and value key here and add

17
00:01:28,100 --> 00:01:28,940
value here.

18
00:01:29,750 --> 00:01:30,200
So.

19
00:01:32,520 --> 00:01:42,750
In cases where there are multiple values, they will look like this is a value one value to and value

20
00:01:42,760 --> 00:01:44,610
three and vice versa here.

21
00:01:45,450 --> 00: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

22
00:01:53,790 --> 00:01:54,870
marks here.

23
00:01:56,710 --> 00:01:57,410
Like that?

24
00:01:58,800 --> 00:02:00,290
While the fourth.

25
00:02:02,720 --> 00:02:03,140
So.

26
00:02:08,140 --> 00:02:12,640
So in in your environment, in your shell is your best shell.

27
00:02:12,910 --> 00:02:19,540
So each user, including ruled, has a different set of environment variables that determine how the

28
00:02:19,540 --> 00:02:21,280
system looks, acts and.

29
00:02:22,060 --> 00:02:28,570
So you can change the values for these variables to make your system work more efficiently.

30
00:02:28,810 --> 00:02:33,970
Tailor your work environment to best meet your individual needs and potentially cover your tracks if

31
00:02:33,970 --> 00:02:34,660
you need to.

32
00:02:35,740 --> 00:02:42,100
So leaving and modifying environment variables so you can be while your default environment variables

33
00:02:42,100 --> 00:02:49,060
by entering any V into your terminal from any directory like so here.

34
00:02:49,960 --> 00:02:54,010
So as you can see, there is a light environment variables here.

35
00:02:57,660 --> 00:03:03,660
So environment variables are always upper case, as you can see here.

36
00:03:05,190 --> 00:03:12,570
So, including shell variables, local variables and show functions such as any user defined variables

37
00:03:12,570 --> 00:03:20,050
and command aliases, some use a set common this command will list all environment variables.

38
00:03:20,520 --> 00:03:28,410
Um, on environment variables unique to your system, which is the most cases will give you an output

39
00:03:28,410 --> 00:03:33,660
so long you won't be able to view it, uh, on a single screen here.

40
00:03:34,230 --> 00:03:35,430
So you can see here.

41
00:03:36,360 --> 00:03:40,410
We have so many environment variables here.

42
00:03:43,680 --> 00: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.

43
00:03:52,620 --> 00:03:53,070
Said.

44
00:03:54,260 --> 00:03:55,880
And more here.

45
00:03:57,220 --> 00:04:00,100
Now we can see like that by pressing enter.

46
00:04:00,430 --> 00:04:02,040
We can see a sequential.

47
00:04:02,400 --> 00:04:10,990
So let's see more more and, uh, press in one time control and save or exit or quit here.

48
00:04:11,980 --> 00: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

49
00:04:17,740 --> 00:04:18,880
line and then stop.

50
00:04:19,330 --> 00:04:26,940
Uh, when you press enter like that, uh, or space or, uh, spin in space and you will see more here.

51
00:04:28,160 --> 00:04:36,020
Uh, so, uh, taking you to the next variable so you can scroll through pressing or holding, enter

52
00:04:36,020 --> 00:04:36,560
like that.

53
00:04:37,190 --> 00:04:37,580
So.

54
00:04:39,490 --> 00:04:46,990
As you might recall, from previous chapters and elections, whenever you you use, the more common

55
00:04:46,990 --> 00:04:59,380
for output you can enter key it to or exit and return command to like that or control plus easier.

56
00:05:00,190 --> 00:05:03,490
So filtering for particular variables?

57
00:05:03,910 --> 00:05:06,160
Let me, uh, see here.

58
00:05:06,170 --> 00:05:14,440
So, uh, I'll talk to you using sent, uh, with more gifts, more, uh, manageable results than working

59
00:05:14,440 --> 00:05:20,950
through the whole chunk of variable names you get with this sit along like that.

60
00:05:22,030 --> 00:05:23,020
Uh, so.

61
00:05:24,740 --> 00:05:28,580
It can still be a rather tedious if you are looking for a particular variable.

62
00:05:28,880 --> 00:05:35,540
Instead, you can use the filtering command grant, um to find your variable of interest.

63
00:05:35,960 --> 00:05:39,350
So let's use the variable his size as an example.

64
00:05:39,770 --> 00:05:46,070
So this variable contains his size on this variable contains the maximum number of comments you were.

65
00:05:46,070 --> 00:05:48,470
Common history of a file was stored.

66
00:05:49,190 --> 00:05:58,310
So his size is the maximum and number of commands your command history file will start to his commands

67
00:05:58,550 --> 00:06:06,070
or any was previously typed into your command prompt in the session and can be recalled with your up

68
00:06:06,080 --> 00:06:10,760
here, up and down, uh, keywords like that.

69
00:06:13,440 --> 00:06:19,710
So you're not at his size, doesn't store the comments themselves, just a number of them that can be

70
00:06:19,720 --> 00:06:29,580
stored so popular, sit here said, Oh crap, actually cramp his size.

71
00:06:29,970 --> 00:06:30,300
Yeah.

72
00:06:30,980 --> 00:06:33,870
Well, as you can see, his size is 1000.

73
00:06:34,200 --> 00:06:39,840
As you can see, the common finds the variable, his size, and this place is its value.

74
00:06:40,230 --> 00:06:45,570
The default value of this variable is probably set to one thousand here, as you can see on your system,

75
00:06:45,570 --> 00:06:45,900
too.

76
00:06:46,230 --> 00:06:52,080
So this indicates the terminal this storage would last 1000 commands by default.
