1
00:00:00,930 --> 00:00:08,850
Changing gears shall prompt your share from the environment variable here provides you with useful information,

2
00:00:08,850 --> 00:00:14,850
such as the user you are operating as and the director in which you're currently working.

3
00:00:15,120 --> 00:00:18,930
So the default should prompt in color text the following year.

4
00:00:19,380 --> 00:00:27,480
Users here can use their name, first name and current, uh, current directory.

5
00:00:29,310 --> 00:00:36,450
So if you're working with the real route user, this translates to this, for example, root at Cowley

6
00:00:36,450 --> 00:00:39,300
and Core and Directory.

7
00:00:43,540 --> 00:00:49,750
So you can change the name in the default shopfront by setting the value from the Florida is one variable

8
00:00:49,750 --> 00:00:55,600
that so the is one variable has set of placeholders for information you want to display in the prompt,

9
00:00:56,260 --> 00:01:03,010
including the name of the current user, the host name and the base name of the current working directory.

10
00:01:04,030 --> 00:01:11,050
So this is very useful if you happen to have shows on multiple systems are a little bit on an as multiple

11
00:01:11,050 --> 00:01:11,530
accounts.

12
00:01:11,550 --> 00:01:18,970
So by setting different users and host names and values for different channels or accounts, you can

13
00:01:18,970 --> 00:01:23,410
tell at a glance who you are and what your current system is.

14
00:01:23,890 --> 00:01:27,460
So let's have a little fun on showing the prompt in your terminal.

15
00:01:27,460 --> 00:01:30,780
For example, you could enter here.

16
00:01:30,860 --> 00:01:31,960
Pierce one.

17
00:01:33,170 --> 00:01:43,250
Here, uh, for example, uh, World's best anchor here and his shtick here.

18
00:01:45,180 --> 00:01:49,950
As you can see here now, our common theme is like that here.

19
00:01:50,580 --> 00:01:56,040
So now every time you use this terminal, you will be reminded that you are the world's best hacker.

20
00:01:56,400 --> 00:02:02,670
But any subsequent terminal you open will still have the default command ground because the P is one

21
00:02:02,670 --> 00:02:06,030
variable only those values for your terminal session.

22
00:02:06,360 --> 00:02:10,860
Remember, until you export a variable, it is only good for that session.

23
00:02:11,280 --> 00:02:17,740
So if you really like this new command prompt and want to see it in every terminal, you need to take

24
00:02:18,000 --> 00:02:19,020
a unit to export it.

25
00:02:19,020 --> 00:02:21,840
So like that, export P.S. one.

26
00:02:21,840 --> 00:02:30,690
But I will not do it in this year, so this will make the chains so chain dependent across all sessions.

27
00:02:31,570 --> 00:02:33,360
How about a little more fun?

28
00:02:33,390 --> 00:02:38,670
Here's the thing you really want your terminal to look like the Windows CE in the prompt.

29
00:02:39,420 --> 00:02:43,730
So that's actually it's quite boring actually here.

30
00:02:44,790 --> 00:02:51,000
So say you really want your terminal to look like a windows in the prop.

31
00:02:51,390 --> 00:02:56,760
So in this case, you can't change the prompt name you see and keep it down below.

32
00:02:56,760 --> 00:03:03,060
Have to control your current directory as here, for example, export.

33
00:03:04,130 --> 00:03:11,210
Export p es from excellent experience one.

34
00:03:11,780 --> 00:03:23,600
And here in this film, we see him here, so we see and hear, you know, override Tableau for directory

35
00:03:23,600 --> 00:03:25,430
extrication, as you can see here.

36
00:03:39,010 --> 00:03:39,370
Here.

37
00:03:43,320 --> 00:03:43,710
Like there.

38
00:03:47,620 --> 00:03:50,290
We can do it for some severe bone loss.

39
00:03:51,450 --> 00:03:56,220
Like that, so having a prompt from your current director, it can be generally useful.

40
00:03:56,490 --> 00:03:57,840
So particularly for beginners.

41
00:03:58,170 --> 00:04:05,320
And so it's something to consider when you change your form variable, we can change pet as well.

42
00:04:05,350 --> 00:04:10,410
So one of the most important variables in your environment is pets.

43
00:04:10,440 --> 00:04:12,750
Variable, actually, it's boring, actually.

44
00:04:13,170 --> 00:04:19,860
So let's call it so one of the most important variables in your environment is your pet variable.

45
00:04:20,160 --> 00:04:26,160
So which controls were very on your system your shell will look for come once you enters, such as a

46
00:04:26,160 --> 00:04:28,440
see the list or equal here.

47
00:04:29,160 --> 00:04:41,040
So most commands are located in Espin or bin directory here, like a user locale, spin or user.

48
00:04:41,460 --> 00:04:45,630
Uh, use local being yeah.

49
00:04:46,050 --> 00:04:52,380
If the file doesn't find the command in one of the directors in your pet variable, it will return the

50
00:04:52,380 --> 00:04:54,630
command not formed like that, for example.

51
00:04:56,700 --> 00:04:58,200
Common would and liked it.

52
00:04:59,750 --> 00:05:08,000
So even if that comment does exist in the dire straits and, uh, not in your pet, so you can find

53
00:05:08,000 --> 00:05:16,310
out which directors are stored in your pet variable by using Echo and all our sign and pet.

54
00:05:17,180 --> 00:05:17,480
That's true.

55
00:05:17,550 --> 00:05:19,280
How serious are Patea?

56
00:05:19,850 --> 00:05:24,440
These are the directories where your terminal was searched for any command.

57
00:05:24,950 --> 00:05:33,290
When you enter L.A., for example, the system knows to look in each um, each of these directories

58
00:05:33,290 --> 00:05:33,940
for the L.

59
00:05:33,950 --> 00:05:41,270
S Command and when it finds out as, uh, the system executes it like that was.

60
00:05:43,030 --> 00:05:50,020
So each territory is separated by column, and you don't forget to add the dollar symbol in content

61
00:05:50,020 --> 00:05:51,700
pattern, as you can see here.

62
00:05:52,210 --> 00:05:56,200
So we can add them to the patch variable here.

63
00:05:56,410 --> 00:06:02,840
So you can probably see why it is important to know what is in your patch variable if you downloaded

64
00:06:02,890 --> 00:06:09,310
and install the new tool, let's say, for example, new hacking tool here, uh, into the root new

65
00:06:09,310 --> 00:06:10,510
hacking tool directory.

66
00:06:10,510 --> 00:06:16,960
You could only use commands from that tool and you are in that directory because the directory is not

67
00:06:16,960 --> 00:06:18,100
in the path variable.

68
00:06:18,520 --> 00:06:24,640
Every time you want it to use that, all you called you will first have to navigate routinely new hacking

69
00:06:24,830 --> 00:06:28,840
of which is a bit inconvenient if you want to use tool often.

70
00:06:29,410 --> 00:06:37,240
So to be able to use this new tool for any directory, you need to add the directory, uh, to holding

71
00:06:37,240 --> 00:06:42,370
this tool to your path variable to add new and you hacking tool to your pet's variable.

72
00:06:42,370 --> 00:06:51,160
Enter this command paths here equals here to our path and to that column here.

73
00:06:51,550 --> 00:06:54,880
And, for example, route new hacking tool.

74
00:06:54,880 --> 00:06:57,340
Here we added path variable here.

75
00:06:57,790 --> 00:07:06,100
So this assigns the original patch variable plus this the folder here directory to path to the new path

76
00:07:06,100 --> 00:07:06,520
variable.

77
00:07:06,790 --> 00:07:11,350
So the variable contains everything it did before, plus new tool directory.

78
00:07:12,190 --> 00:07:18,400
If you examine the contents of the patch variable, uh, again you should see that this directory has

79
00:07:18,400 --> 00:07:23,280
been appended to the end of the path, as shown here and Equal Partner X.

80
00:07:25,680 --> 00:07:28,050
Echo what, Pat?

81
00:07:29,370 --> 00:07:34,170
So you can see where that is, uh, a rule, it's new hacking tool here.

82
00:07:34,800 --> 00:07:40,590
So now you can accept new hacking tool applications from anywhere on your system rather than having

83
00:07:40,590 --> 00:07:43,540
navigate to is selected in the Bachelor.

84
00:07:43,570 --> 00:07:46,980
Look in our directories list for your new tool.

85
00:07:48,350 --> 00:07:51,530
So how not to add that valuable?

86
00:07:51,740 --> 00:07:59,030
So one mistake commonly made by new Linux users is assigning a new directory, such as the root new

87
00:07:59,270 --> 00:08:03,620
hiking tool to the patch variable like that had.

88
00:08:04,710 --> 00:08:08,190
Uh, here, uh, route new directory.

89
00:08:11,870 --> 00:08:13,100
New hacking.

90
00:08:14,100 --> 00:08:21,720
Look at this view, if you use this command, you'll pack variable will only contain the new hacking

91
00:08:21,750 --> 00:08:22,140
tool.

92
00:08:22,500 --> 00:08:28,740
So your pet variable will not contain this and you will delete all of these pet variables and only add

93
00:08:28,740 --> 00:08:29,110
this.

94
00:08:30,060 --> 00:08:32,070
This is useless.

95
00:08:32,190 --> 00:08:33,180
Uh, fortunately.

96
00:08:33,750 --> 00:08:35,580
So um.

97
00:08:37,720 --> 00:08:43,330
And no longer contain the system binaries directories such as being on the scene, so after doing this

98
00:08:43,330 --> 00:08:46,980
command, you cannot use LCD or any comments here.

99
00:08:47,760 --> 00:08:54,930
So when you then go to use any of these comments, you will receive the error command not found here.

100
00:08:55,880 --> 00:09:00,810
So remember that you want to append to the pet variable, not replace it.

101
00:09:00,820 --> 00:09:05,940
So if you are in doubt, send the contents of the variable somewhere before you modify it.

102
00:09:07,420 --> 00:09:07,870
So.

103
00:09:09,130 --> 00:09:15,250
We can create a user defined variable as well, so you can create your own custom user defined variables

104
00:09:15,250 --> 00:09:19,600
in Linux by simply assigning evaluate will be a new variable that you name.

105
00:09:20,230 --> 00:09:28,060
So this may be useful when you are doing the same as some more advanced scripting or find you are often

106
00:09:28,240 --> 00:09:32,500
using a long common that you get tired of typing over and over.

107
00:09:32,830 --> 00:09:38,260
So the syntax is straightforward enter the name of your variable, followed by assignment, assignment

108
00:09:38,270 --> 00:09:46,270
symbol and then the value to part in the variable as here, for example, my new variable and.

109
00:09:47,190 --> 00:10:01,440
Uh, here and for example, hacking is the most valuable, valuable skill set in the twenty first century.

110
00:10:04,810 --> 00:10:05,080
You.

111
00:10:06,730 --> 00:10:13,460
So this assigns a string to the variable mine environment, so to see the value in the VAT in that variable

112
00:10:13,460 --> 00:10:22,180
and use the Echo Command and the dollar content symbol to with the variable name, as we did earlier

113
00:10:22,180 --> 00:10:22,570
here.

114
00:10:22,900 --> 00:10:25,570
My new variable, which?

115
00:10:26,510 --> 00:10:32,720
As you can see, they're just like our system environment variables, user defined variables must be

116
00:10:32,720 --> 00:10:35,600
exported to persist to new sessions.

117
00:10:36,260 --> 00:10:45,680
So if you want to delete these new moneyball. or any variable use that on set on onset myname variable

118
00:10:46,760 --> 00:10:47,060
here.

119
00:10:47,330 --> 00:10:48,710
So now it's equal.

120
00:10:48,800 --> 00:10:51,440
And as you can see, we have no new variable pitch.

121
00:10:52,260 --> 00:10:52,670
So.

122
00:10:53,910 --> 00:11:00,240
You mean, because we deal with this variable with Ansett command and have to, uh, press and equal

123
00:11:00,330 --> 00:11:02,040
for printing to tomorrow?

124
00:11:02,160 --> 00:11:05,130
We can't see it because there is no credibility here.

125
00:11:05,160 --> 00:11:07,020
After all, setting this variable.

126
00:11:07,950 --> 00:11:13,830
So lastly, you might find in white, I'm afraid it was foreign, but it's worth getting to know them

127
00:11:13,980 --> 00:11:21,420
so they control how your working environment in Linux looks, acts and feels so you can manage these

128
00:11:21,420 --> 00:11:28,140
variables to tell in your environment, to your needs by changing them, exporting them and even creating

129
00:11:28,140 --> 00:11:30,720
your own, as we did in this case.

130
00:11:31,140 --> 00:11:35,760
So in some cases, these they may be useful for covering your tracks as a hacker.
