WEBVTT

00:00.930 --> 00:08.850
Changing gears shall prompt your share from the environment variable here provides you with useful information,

00:08.850 --> 00:14.850
such as the user you are operating as and the director in which you're currently working.

00:15.120 --> 00:18.930
So the default should prompt in color text the following year.

00:19.380 --> 00:27.480
Users here can use their name, first name and current, uh, current directory.

00:29.310 --> 00:36.450
So if you're working with the real route user, this translates to this, for example, root at Cowley

00:36.450 --> 00:39.300
and Core and Directory.

00:43.540 --> 00:49.750
So you can change the name in the default shopfront by setting the value from the Florida is one variable

00:49.750 --> 00:55.600
that so the is one variable has set of placeholders for information you want to display in the prompt,

00:56.260 --> 01:03.010
including the name of the current user, the host name and the base name of the current working directory.

01:04.030 --> 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

01:11.050 --> 01:11.530
accounts.

01:11.550 --> 01:18.970
So by setting different users and host names and values for different channels or accounts, you can

01:18.970 --> 01:23.410
tell at a glance who you are and what your current system is.

01:23.890 --> 01:27.460
So let's have a little fun on showing the prompt in your terminal.

01:27.460 --> 01:30.780
For example, you could enter here.

01:30.860 --> 01:31.960
Pierce one.

01:33.170 --> 01:43.250
Here, uh, for example, uh, World's best anchor here and his shtick here.

01:45.180 --> 01:49.950
As you can see here now, our common theme is like that here.

01:50.580 --> 01:56.040
So now every time you use this terminal, you will be reminded that you are the world's best hacker.

01:56.400 --> 02:02.670
But any subsequent terminal you open will still have the default command ground because the P is one

02:02.670 --> 02:06.030
variable only those values for your terminal session.

02:06.360 --> 02:10.860
Remember, until you export a variable, it is only good for that session.

02:11.280 --> 02:17.740
So if you really like this new command prompt and want to see it in every terminal, you need to take

02:18.000 --> 02:19.020
a unit to export it.

02:19.020 --> 02:21.840
So like that, export P.S. one.

02:21.840 --> 02:30.690
But I will not do it in this year, so this will make the chains so chain dependent across all sessions.

02:31.570 --> 02:33.360
How about a little more fun?

02:33.390 --> 02:38.670
Here's the thing you really want your terminal to look like the Windows CE in the prompt.

02:39.420 --> 02:43.730
So that's actually it's quite boring actually here.

02:44.790 --> 02:51.000
So say you really want your terminal to look like a windows in the prop.

02:51.390 --> 02:56.760
So in this case, you can't change the prompt name you see and keep it down below.

02:56.760 --> 03:03.060
Have to control your current directory as here, for example, export.

03:04.130 --> 03:11.210
Export p es from excellent experience one.

03:11.780 --> 03:23.600
And here in this film, we see him here, so we see and hear, you know, override Tableau for directory

03:23.600 --> 03:25.430
extrication, as you can see here.

03:39.010 --> 03:39.370
Here.

03:43.320 --> 03:43.710
Like there.

03:47.620 --> 03:50.290
We can do it for some severe bone loss.

03:51.450 --> 03:56.220
Like that, so having a prompt from your current director, it can be generally useful.

03:56.490 --> 03:57.840
So particularly for beginners.

03:58.170 --> 04:05.320
And so it's something to consider when you change your form variable, we can change pet as well.

04:05.350 --> 04:10.410
So one of the most important variables in your environment is pets.

04:10.440 --> 04:12.750
Variable, actually, it's boring, actually.

04:13.170 --> 04:19.860
So let's call it so one of the most important variables in your environment is your pet variable.

04:20.160 --> 04:26.160
So which controls were very on your system your shell will look for come once you enters, such as a

04:26.160 --> 04:28.440
see the list or equal here.

04:29.160 --> 04:41.040
So most commands are located in Espin or bin directory here, like a user locale, spin or user.

04:41.460 --> 04:45.630
Uh, use local being yeah.

04:46.050 --> 04:52.380
If the file doesn't find the command in one of the directors in your pet variable, it will return the

04:52.380 --> 04:54.630
command not formed like that, for example.

04:56.700 --> 04:58.200
Common would and liked it.

04:59.750 --> 05:08.000
So even if that comment does exist in the dire straits and, uh, not in your pet, so you can find

05:08.000 --> 05:16.310
out which directors are stored in your pet variable by using Echo and all our sign and pet.

05:17.180 --> 05:17.480
That's true.

05:17.550 --> 05:19.280
How serious are Patea?

05:19.850 --> 05:24.440
These are the directories where your terminal was searched for any command.

05:24.950 --> 05:33.290
When you enter L.A., for example, the system knows to look in each um, each of these directories

05:33.290 --> 05:33.940
for the L.

05:33.950 --> 05:41.270
S Command and when it finds out as, uh, the system executes it like that was.

05:43.030 --> 05:50.020
So each territory is separated by column, and you don't forget to add the dollar symbol in content

05:50.020 --> 05:51.700
pattern, as you can see here.

05:52.210 --> 05:56.200
So we can add them to the patch variable here.

05:56.410 --> 06:02.840
So you can probably see why it is important to know what is in your patch variable if you downloaded

06:02.890 --> 06:09.310
and install the new tool, let's say, for example, new hacking tool here, uh, into the root new

06:09.310 --> 06:10.510
hacking tool directory.

06:10.510 --> 06:16.960
You could only use commands from that tool and you are in that directory because the directory is not

06:16.960 --> 06:18.100
in the path variable.

06:18.520 --> 06:24.640
Every time you want it to use that, all you called you will first have to navigate routinely new hacking

06:24.830 --> 06:28.840
of which is a bit inconvenient if you want to use tool often.

06:29.410 --> 06:37.240
So to be able to use this new tool for any directory, you need to add the directory, uh, to holding

06:37.240 --> 06:42.370
this tool to your path variable to add new and you hacking tool to your pet's variable.

06:42.370 --> 06:51.160
Enter this command paths here equals here to our path and to that column here.

06:51.550 --> 06:54.880
And, for example, route new hacking tool.

06:54.880 --> 06:57.340
Here we added path variable here.

06:57.790 --> 07:06.100
So this assigns the original patch variable plus this the folder here directory to path to the new path

07:06.100 --> 07:06.520
variable.

07:06.790 --> 07:11.350
So the variable contains everything it did before, plus new tool directory.

07:12.190 --> 07:18.400
If you examine the contents of the patch variable, uh, again you should see that this directory has

07:18.400 --> 07:23.280
been appended to the end of the path, as shown here and Equal Partner X.

07:25.680 --> 07:28.050
Echo what, Pat?

07:29.370 --> 07:34.170
So you can see where that is, uh, a rule, it's new hacking tool here.

07:34.800 --> 07:40.590
So now you can accept new hacking tool applications from anywhere on your system rather than having

07:40.590 --> 07:43.540
navigate to is selected in the Bachelor.

07:43.570 --> 07:46.980
Look in our directories list for your new tool.

07:48.350 --> 07:51.530
So how not to add that valuable?

07:51.740 --> 07:59.030
So one mistake commonly made by new Linux users is assigning a new directory, such as the root new

07:59.270 --> 08:03.620
hiking tool to the patch variable like that had.

08:04.710 --> 08:08.190
Uh, here, uh, route new directory.

08:11.870 --> 08:13.100
New hacking.

08:14.100 --> 08:21.720
Look at this view, if you use this command, you'll pack variable will only contain the new hacking

08:21.750 --> 08:22.140
tool.

08:22.500 --> 08:28.740
So your pet variable will not contain this and you will delete all of these pet variables and only add

08:28.740 --> 08:29.110
this.

08:30.060 --> 08:32.070
This is useless.

08:32.190 --> 08:33.180
Uh, fortunately.

08:33.750 --> 08:35.580
So um.

08:37.720 --> 08:43.330
And no longer contain the system binaries directories such as being on the scene, so after doing this

08:43.330 --> 08:46.980
command, you cannot use LCD or any comments here.

08:47.760 --> 08:54.930
So when you then go to use any of these comments, you will receive the error command not found here.

08:55.880 --> 09:00.810
So remember that you want to append to the pet variable, not replace it.

09:00.820 --> 09:05.940
So if you are in doubt, send the contents of the variable somewhere before you modify it.

09:07.420 --> 09:07.870
So.

09:09.130 --> 09:15.250
We can create a user defined variable as well, so you can create your own custom user defined variables

09:15.250 --> 09:19.600
in Linux by simply assigning evaluate will be a new variable that you name.

09:20.230 --> 09:28.060
So this may be useful when you are doing the same as some more advanced scripting or find you are often

09:28.240 --> 09:32.500
using a long common that you get tired of typing over and over.

09:32.830 --> 09:38.260
So the syntax is straightforward enter the name of your variable, followed by assignment, assignment

09:38.270 --> 09:46.270
symbol and then the value to part in the variable as here, for example, my new variable and.

09:47.190 --> 10:01.440
Uh, here and for example, hacking is the most valuable, valuable skill set in the twenty first century.

10:04.810 --> 10:05.080
You.

10:06.730 --> 10:13.460
So this assigns a string to the variable mine environment, so to see the value in the VAT in that variable

10:13.460 --> 10:22.180
and use the Echo Command and the dollar content symbol to with the variable name, as we did earlier

10:22.180 --> 10:22.570
here.

10:22.900 --> 10:25.570
My new variable, which?

10:26.510 --> 10:32.720
As you can see, they're just like our system environment variables, user defined variables must be

10:32.720 --> 10:35.600
exported to persist to new sessions.

10:36.260 --> 10:45.680
So if you want to delete these new moneyball. or any variable use that on set on onset myname variable

10:46.760 --> 10:47.060
here.

10:47.330 --> 10:48.710
So now it's equal.

10:48.800 --> 10:51.440
And as you can see, we have no new variable pitch.

10:52.260 --> 10:52.670
So.

10:53.910 --> 11:00.240
You mean, because we deal with this variable with Ansett command and have to, uh, press and equal

11:00.330 --> 11:02.040
for printing to tomorrow?

11:02.160 --> 11:05.130
We can't see it because there is no credibility here.

11:05.160 --> 11:07.020
After all, setting this variable.

11:07.950 --> 11:13.830
So lastly, you might find in white, I'm afraid it was foreign, but it's worth getting to know them

11:13.980 --> 11:21.420
so they control how your working environment in Linux looks, acts and feels so you can manage these

11:21.420 --> 11:28.140
variables to tell in your environment, to your needs by changing them, exporting them and even creating

11:28.140 --> 11:30.720
your own, as we did in this case.

11:31.140 --> 11:35.760
So in some cases, these they may be useful for covering your tracks as a hacker.
