WEBVTT

00:00.000 --> 00:02.060
All right, thank you all for your patience.

00:02.060 --> 00:03.980
We are about to officially start.

00:05.060 --> 00:07.880
Good afternoon slash morning.

00:07.880 --> 00:26.360
It is an honor to introduce DJ Davis, a seasoned IT professional whose career began on IBM mainframes and mid-range systems and expanded to encompass systems engineering, network design, and information security.

00:26.360 --> 00:34.080
DJ holds a bachelor's and a master's degree in business information systems and currently works in the Washington, D.C.

00:34.080 --> 00:38.570
area helping others navigate complex IT ecosystems.

00:39.240 --> 00:50.980
With decades of experience and a passion for mentoring, DJ has made it his mission to reduce the intimidation factor that often surrounds Linux.

00:51.480 --> 01:02.100
His talk today, Let's Lose the Shock, Mystery of Linux, offers a pain-free introduction to Linux and compares his features to those of Microsoft Windows.

01:02.100 --> 01:07.020
If you ever felt hesitant to dive into the Linux world, this is your chance to change that.

01:07.160 --> 01:09.880
Please join me in welcoming DJ Davis.

01:20.300 --> 01:21.900
Awesome, welcome.

01:22.460 --> 01:24.020
Hey, George.

01:32.210 --> 01:33.110
Well , welcome.

01:33.290 --> 01:38.770
Thank you, everyone, for coming to the Blacks in Cyber sessions and presentations.

01:38.770 --> 01:43.110
And thanks for coming to DEF CON because, you know, we have a lot of fun here.

01:43.190 --> 01:49.230
And hopefully we'll have a lot of fun today as we lose the shock value of Linux.

01:49.230 --> 01:50.730
Are y'all ready to have some fun?

01:50.910 --> 01:52.530
All right, all right, all right.

01:52.650 --> 01:56.250
So let's get started into this.

01:56.250 --> 02:00.010
I'll tell you, well, we see the objectives that we have for this.

02:00.150 --> 02:02.590
So, you know, this is an overview awareness.

02:02.590 --> 02:05.050
We're not going to go into all commands and that kind of stuff.

02:05.050 --> 02:06.090
We're not going to be boring.

02:06.090 --> 02:14.610
But, you know, we're going to talk about the difference, you know, between Microsoft Windows and Linux and what have you.

02:14.610 --> 02:18.190
And look into a few of the features and things of this.

02:19.310 --> 02:22.170
So this is our game plan for today.

02:22.170 --> 02:24.990
We're not going to go heavy into comparing distributions.

02:24.990 --> 02:27.630
Let's say that all of the distributions are good.

02:27.630 --> 02:31.130
You know, you pick the one that you like and then you pick another and another.

02:31.130 --> 02:33.190
Have a lot of fun with this.

02:33.270 --> 02:38.510
So we're going to have installing Linux in the appendix.

02:38.510 --> 02:41.170
You'll be able to go there and see that.

02:41.250 --> 02:44.370
And this slide deck will be on GitHub.

02:44.370 --> 02:46.330
So it's there for you.

02:46.330 --> 02:49.510
Maybe we'll see if we can hold the questions until the end of this.

02:49.510 --> 02:51.130
Just keep this moving.

02:51.130 --> 02:55.370
And my usual disclaimer is that this is not affiliated with work.

02:55.370 --> 02:56.870
You know, these are my ideas.

02:56.950 --> 03:01.190
However, you know, work is like fine, cool with me being here.

03:03.130 --> 03:05.070
You heard a little bit about my background.

03:05.070 --> 03:06.650
We're not going to spend much time with this.

03:06.650 --> 03:09.770
But, you know, just in different areas of computing, whatnot.

03:09.770 --> 03:15.310
And currently, you know, I work in IT security in that sector.

03:15.310 --> 03:16.670
Lots of fun there.

03:16.670 --> 03:19.750
My alma mater, VCU, go Rams.

03:20.350 --> 03:21.420
Pretty good school.

03:22.850 --> 03:27.730
So there are a lot of reasons to learn and to use Linux.

03:27.730 --> 03:29.770
So a lot of them are listed here.

03:29.870 --> 03:34.310
I'll just focus on a few toward the bottom of this.

03:34.410 --> 03:39.490
It's great for learning about, you know, how computers work and using different kinds of languages.

03:39.490 --> 03:43.770
You know, on a small machine, you can load a whole bunch of languages.

03:43.870 --> 03:45.010
I do.

03:45.010 --> 03:53.910
So it's a great operating system to see how, you know, things work into detail.

03:53.910 --> 03:56.410
We'll have a little bit of detail here.

03:56.410 --> 03:59.290
It's good for hardware and software hacking.

03:59.290 --> 04:02.510
So pretty soon, if you're not doing that, you will be.

04:02.770 --> 04:05.670
Linux has a rich set of commands.

04:05.670 --> 04:06.730
I love some of the commands.

04:06.730 --> 04:08.530
I mentioned DD and grep.

04:08.530 --> 04:13.550
For no reason other than that, I think it's a good reason to use Linux.

04:13.550 --> 04:22.950
And essentially, it's a very stable, reliable, and powerful OS that is like a free version of Unix.

04:23.790 --> 04:25.190
Unix, did I say?

04:25.190 --> 04:27.310
So what's special about Unix?

04:27.910 --> 04:31.330
Unix gets into, you know, why Linux is around.

04:31.330 --> 04:42.690
So Unix was the first portable, and that's an interesting word, portable operating system, and portable means to copy it from one place to somewhere else.

04:42.690 --> 04:48.190
That was the first operating system that came out, and they were able to do that with.

04:48.190 --> 04:50.590
There's a modular design.

04:50.970 --> 04:52.950
That's pretty good for several reasons.

04:52.950 --> 04:57.310
And Linux, or Unix, started with inter-process communication.

04:57.370 --> 05:02.730
Microsoft uses this too, because if you've ever used a command prompt, you use that pipe thing.

05:02.730 --> 05:07.650
Yeah, Microsoft borrowed that from Unix at the time.

05:07.830 --> 05:11.490
You have input and output redirection.

05:11.490 --> 05:15.330
We see that less than, greater than, sign, those types of things.

05:15.490 --> 05:20.290
And there are three files that are opened automatically for each process.

05:20.290 --> 05:23.830
Standard in, standard out, and standard error.

05:23.830 --> 05:27.790
Okay, so this is a partial list of Linux distributions.

05:27.790 --> 05:29.750
You might see your favorite one on the list.

05:29.750 --> 05:32.850
You know, pick any of these or pick other ones.

05:33.850 --> 05:40.310
So, some differences between the commands of Linux and Microsoft.

05:40.310 --> 05:45.690
Yeah, the green Linux shows somewhat on this slide.

05:46.550 --> 05:55.070
But, so basically, we have the clear, C-L-E-A-R, for clearing the screen, versus the C-L-S.

05:55.070 --> 06:01.150
You know, you grow up on that, and you get used to that in Microsoft, the C-L-S.

06:01.190 --> 06:04.230
How we separate parts of a file.

06:04.230 --> 06:07.570
Linux uses the forward slash.

06:07.570 --> 06:10.750
Microsoft uses the backslash.

06:10.750 --> 06:14.450
Then there is that fun thing about null versus null.

06:14.450 --> 06:23.990
It's, you know, N-U-L on Microsoft, and it's dev or device null, N-U-L-L, for Linux.

06:24.310 --> 06:29.010
There are some other differences in this command, in these commands, as you see here.

06:29.470 --> 06:32.810
You know, just how you do different things.

06:32.810 --> 06:37.710
Some of these, the commands might be the same, but the operation might be a little different.

06:37.710 --> 06:40.790
For example, changing a directory CD.

06:41.670 --> 06:47.890
That can work a little bit differently in both of those.

06:49.310 --> 06:56.290
Linux does have a live distribution, and you can run that off of a USB.

06:56.750 --> 07:00.130
I don't think you can do that that often with Microsoft.

07:00.130 --> 07:06.690
Although they do have some type of third-party thing that you can get, buy, or what have you.

07:06.770 --> 07:11.770
One nice thing that Microsoft does have is the pause command.

07:12.890 --> 07:18.870
And on here, we show how you would implement that in Linux.

07:18.870 --> 07:21.390
You know, you use the read command and a few options.

07:21.390 --> 07:24.830
That's here on the slide, and these would be, you know, available.

07:24.830 --> 07:32.710
There are other differences in things, you know, between the two operating systems as we see here.

07:32.710 --> 07:36.270
In Linux, you tend to work more with the command line.

07:36.270 --> 07:41.050
You tend to work more with the GUI in Microsoft.

07:41.850 --> 07:45.950
Linux has a lot of free languages and things that are available.

07:45.950 --> 07:47.430
Not so much.

07:47.430 --> 07:52.090
Well, you do have some in Microsoft.

07:52.970 --> 07:56.430
And so that support is getting a lot better.

07:58.030 --> 08:06.270
Scripting is a little bit different as well, because you generally script with Bash in Linux, but you can script with other things as well.

08:06.270 --> 08:15.610
Microsoft is going to be, you know, using the PowerShell or using the command prompt.

08:16.210 --> 08:17.780
Some other differences.

08:17.780 --> 08:26.760
The super user account in Linux's root in Microsoft is administrator.

08:26.760 --> 08:29.560
Now, in Microsoft, you can change that.

08:29.560 --> 08:33.520
You cannot change that in Linux.

08:33.660 --> 08:36.020
I wouldn't recommend trying to do that.

08:36.020 --> 08:40.180
You'd have to change a lot of underlying stuff to change that.

08:40.180 --> 08:43.060
And we'll look at the general format of the commands.

08:43.060 --> 08:48.200
It's not too difficult to work with, but there are just some things to be aware of.

08:48.200 --> 08:50.840
So, where did Linux come from?

08:50.840 --> 08:53.540
We outlined this in the slide right here.

08:53.540 --> 08:55.880
And so it began in 1969.

08:56.400 --> 09:00.780
AT&T, Bell Labs, they wanted to come up with a new operating system.

09:01.380 --> 09:05.380
In that same year, coincidentally, Linus Torvos was born.

09:05.480 --> 09:06.600
1969.

09:06.600 --> 09:18.300
So, in the late 1970s, AT&T decided to release Unix for universities and some commercial use.

09:18.300 --> 09:22.700
Before then, it was used only by AT&T.

09:22.740 --> 09:27.780
In 1987, not sure if you heard of this part.

09:27.780 --> 09:34.480
This gentleman named Andrew Tannenbaum wrote an operating system called Minix.

09:34.480 --> 09:40.440
And that kind of mimicked the operation of Unix.

09:40.440 --> 09:43.590
But he had that for educational purposes.

09:43.920 --> 09:52.500
In 1987, he came out with this book here, Operating Systems, that had some of the code in it.

09:52.500 --> 09:57.660
And this book was used by universities and places like that.

09:57.660 --> 10:03.680
I happened to see this book at least a few years later after that.

10:03.680 --> 10:08.500
I was hanging out in the Philippines for a while and I went in a bookstore.

10:08.580 --> 10:11.320
And they had a second printing of that.

10:11.320 --> 10:14.120
And it was a nice book and I purchased it.

10:14.120 --> 10:15.540
It's in my garage someplace.

10:15.540 --> 10:16.440
I looked for it.

10:16.440 --> 10:18.080
I can't find that book.

10:18.080 --> 10:20.000
But it's a nice book to have.

10:20.020 --> 10:27.080
So, in 1988, we have Linus Torvos who attends the University of Helsinki.

10:27.360 --> 10:30.640
He goes away for a little while and starts coming back.

10:30.640 --> 10:37.000
Anyway, Linus gets a copy of the book, the software, and he starts playing with it.

10:37.000 --> 10:39.200
He creates the Linux kernel.

10:40.000 --> 10:49.460
The other notable thing about the Linux kernel is that he changed the license of it to GNU Project.

10:49.460 --> 10:56.180
That way, you'd be able to sell it and whatnot and use it more for commercial use.

10:56.180 --> 11:00.820
That's basically how Linux came about from Unix.

11:00.820 --> 11:05.680
And we had that book about the operating systems.

11:06.160 --> 11:08.200
So, what is Linux?

11:08.200 --> 11:10.980
We're going to talk about what it is, what it's not.

11:10.980 --> 11:13.260
We know that it's an operating system.

11:13.260 --> 11:14.980
Linux has a kernel.

11:15.280 --> 11:21.540
And that kernel is the main thing that Linus Torvos works on.

11:21.620 --> 11:23.960
There are other pieces of it as well.

11:23.960 --> 11:25.970
The system bootloader.

11:26.490 --> 11:28.810
Several different types of bootloaders.

11:28.810 --> 11:30.670
And they're pretty good bootloaders.

11:31.010 --> 11:31.790
Grub.

11:31.790 --> 11:40.010
One nice thing about the Linux bootloaders is that they're good at loading in Microsoft Windows as well.

11:40.010 --> 11:41.350
So, dual boot.

11:41.350 --> 11:44.430
You would tend to put Linux on there first.

11:44.470 --> 11:47.390
So, you have the command line interpreter.

11:47.390 --> 11:49.150
Most of us know about Bash.

11:49.150 --> 11:52.490
You know, it could be any of these other ones we list.

11:52.490 --> 11:54.310
We have the SH shell.

11:54.310 --> 11:58.950
KSH shell, I believe, is for people who do systems development more.

11:58.950 --> 12:00.270
They would like that.

12:00.270 --> 12:02.170
There is the Bourne shell.

12:02.170 --> 12:03.950
Here is why I mentioned all of these.

12:03.950 --> 12:05.590
I mentioned the Bourne shell.

12:05.590 --> 12:07.610
What does Bash stand for?

12:07.630 --> 12:08.310
Bourne.

12:08.310 --> 12:09.270
Again.

12:09.270 --> 12:10.110
Shell.

12:10.110 --> 12:12.070
So, that's how we get Bash.

12:12.070 --> 12:16.810
You can have a graphics interface, you know, the GUI.

12:16.970 --> 12:19.160
And then you have package managers.

12:19.620 --> 12:23.020
It can be typically one of two types of package managers.

12:23.020 --> 12:25.120
You have the Red Hat one.

12:25.120 --> 12:28.020
We have the RPM, the YUM, all of that stuff.

12:28.020 --> 12:32.780
Or it can be typically out of the Debian affair where you have the APT.

12:32.780 --> 12:35.740
So, you tend to have one or the other.

12:36.000 --> 12:37.960
You have startup scripts.

12:37.960 --> 12:42.420
And I mentioned two here because it's going to be one of these two.

12:42.420 --> 12:46.840
You know, the system v, vinit, or the system d.

12:46.840 --> 12:51.320
The system d is, you know, the newer one that you tend to see on most systems.

12:52.160 --> 12:55.080
So, Linux, you have a file system.

12:55.080 --> 13:00.300
And I list ext3, which you probably won't see, ext4.

13:00.300 --> 13:05.880
And there are a number of other ones that btrfs is kind of new.

13:05.940 --> 13:16.820
Also, I decided to list FAT32, FAT64, because when you have things like these flash drives, you know, you're kind of using that.

13:16.840 --> 13:23.760
And Linux has other utilities and things that are involved with it.

13:26.580 --> 13:29.800
So, what the kernel is, what the kernel does.

13:29.800 --> 13:33.600
Basically, it is the central core of the machine.

13:33.600 --> 13:40.580
You know, it allocates the memory, does CPU scheduling, the IO, all of these things that we have here.

13:40.580 --> 13:50.300
And we list some of the kernel features, especially to allocate memory and to allocate the time of the CPU.

13:50.460 --> 13:53.440
Most of our computers now have multiple processes.

13:53.500 --> 13:56.860
So, the kernel schedules that.

13:56.860 --> 14:00.180
And you can see, you know, different processes being used.

14:00.180 --> 14:02.740
Okay, what is not in the kernel?

14:02.740 --> 14:04.340
And I believe this is important.

14:04.680 --> 14:08.360
The command line interpreter is not in the kernel.

14:08.360 --> 14:10.580
The GUI is not in the kernel.

14:10.640 --> 14:13.980
Commands, utility programs, those are not in the kernel.

14:13.980 --> 14:15.420
User programs.

14:15.840 --> 14:22.760
Now, sometimes hardware drivers, file systems, and these other things might not be in the kernel.

14:22.760 --> 14:26.140
They might or they might not be, depending upon what they are.

14:26.140 --> 14:29.100
Some of them can be loadable and unloadable.

14:29.100 --> 14:32.940
And so, those are not, you know, written into the kernel per se.

14:32.940 --> 14:35.000
But the kernel can connect to them.

14:35.000 --> 14:37.580
So, this is the current Linux kernel.

14:37.580 --> 14:41.040
It's out, you know, they update this, you know, pretty often.

14:44.500 --> 14:53.360
This version is out, I believe it was July 27, this latest version came out.

14:53.360 --> 14:56.720
So, where do we find the version of the kernel?

14:56.720 --> 14:59.480
And that's going to be in the slash boot directory.

14:59.480 --> 15:04.520
We're going to look more into the different directories and things in a little bit.

15:05.740 --> 15:10.580
If you're in Linux, you can see it by running the uname command.

15:10.580 --> 15:12.940
And there are different varieties of the command.

15:12.940 --> 15:17.220
You put one switch on it, the minus R, and then you get that little name.

15:17.220 --> 15:21.900
The big switch, minus A, you get all of, you know, where the kernel is.

15:22.200 --> 15:27.240
In terms of the source code of the kernel, we list where that is.

15:27.240 --> 15:29.640
You can go and take a look at it.

15:29.820 --> 15:35.720
Interesting thing about it, I believe it says it's 98 point something percent C code.

15:35.720 --> 15:39.760
And on GitHub, it lists what the other variants of it are.

15:39.760 --> 15:44.880
And by the way, it is very good, very well written C code.

15:44.880 --> 15:46.880
Every time I look at it, I'm envious.

15:46.880 --> 15:50.100
I'm like, I've never seen C look this good.

15:50.100 --> 15:53.460
But yeah, they do a very good job at writing that.

15:53.520 --> 16:00.240
Okay, so here's a little illustration that we have that talks about some of the things that are in the kernel.

16:00.240 --> 16:04.380
And we call this the syscall because, you know, system calls.

16:04.380 --> 16:07.940
So, we see this directory path.

16:07.940 --> 16:11.640
Don't worry, you know, you have copy of the slides.

16:11.760 --> 16:18.200
But this directory path has some of the different files of the system calls.

16:18.200 --> 16:20.240
And I highlight where they are.

16:20.580 --> 16:27.920
It's a little tricky finding these because there is also a file called syscall.h, a header file.

16:27.920 --> 16:30.720
But the files are not really listed in there.

16:30.720 --> 16:37.180
And so, I guess when you're compiling, the kernel is winding through all of this stuff to find it.

16:37.840 --> 16:43.700
So, the unistd, we have it for 64-bit and 32-bit.

16:43.700 --> 16:49.560
These are where we can find the different syscalls of the kernel.

16:50.020 --> 16:55.420
So, take a look at a few of these in unist32.

16:55.580 --> 16:57.820
I highlight two of them.

16:57.820 --> 17:01.600
One is the exit, and that's going to be syscall number one.

17:01.600 --> 17:04.820
I highlight the right, syscall number four.

17:04.820 --> 17:06.840
You see a few other ones too.

17:06.840 --> 17:08.960
You see the open and the close.

17:08.960 --> 17:12.300
You see the read in addition to the write.

17:12.300 --> 17:14.940
You're wondering, why is DJ mentioning this?

17:14.940 --> 17:16.540
Okay, let's go to the next slide.

17:16.540 --> 17:30.140
Okay, so, strace is a nice utility that prints out where a program does its system calls.

17:30.140 --> 17:36.180
And basically, we run this by saying the program is an assembly language program.

17:37.440 --> 17:38.320
HelloASM.

17:38.320 --> 17:41.300
And all it does is basically print hello world.

17:41.320 --> 17:42.920
Most of us are familiar with that.

17:42.920 --> 17:49.820
The first thing that you generally do in a language is find out how you print something, hello world, and you do that.

17:49.860 --> 17:53.640
And so, this is the strace of hello world.

17:53.640 --> 17:55.820
There is not a whole lot there.

17:55.880 --> 17:59.960
And it basically does three system calls.

17:59.960 --> 18:02.920
The first one to get in there and start running.

18:03.180 --> 18:05.700
The next one, we're going to do a write.

18:05.700 --> 18:09.900
And it tells the OS how much it's going to write.

18:09.900 --> 18:11.620
And we do an exit.

18:11.620 --> 18:17.360
So, I bolded the system calls in red.

18:17.360 --> 18:26.000
When you see the assembly program over there, you see how we're moving things into a few registers.

18:26.000 --> 18:27.560
And we call the routine.

18:27.560 --> 18:33.220
And so, that directly reflects what we see in the strace.

18:33.220 --> 18:36.580
So, that's for a little assembly language program.

18:36.660 --> 18:41.200
Let's take a look at the one for the C program.

18:41.260 --> 18:44.040
And again, don't worry, not an eye exam.

18:44.040 --> 18:46.400
You have the slides from this.

18:46.920 --> 18:49.600
So, we see a couple of things in here.

18:49.600 --> 18:53.640
We see that there are a whole bunch of system calls.

18:53.780 --> 19:00.340
One of the reasons why C, like other languages, has a standard library.

19:00.340 --> 19:03.120
That standard library does a lot of stuff.

19:03.120 --> 19:08.700
Now, don't worry about all the stuff that it does, because this program actually runs quite quickly.

19:08.700 --> 19:10.800
You know, a couple of milliseconds.

19:11.040 --> 19:14.880
But it does all of these system calls to get things done.

19:14.960 --> 19:22.580
One thing that I will say about the standard library that is unique is that it does buffered I-O.

19:22.580 --> 19:24.540
Buffered I-O is very good.

19:24.540 --> 19:25.420
Here's why.

19:25.420 --> 19:28.980
I'll see if I can cursor up to this assembly program for a second.

19:29.240 --> 19:33.880
You see, if we're writing this in assembly, we're not going to be doing this often.

19:33.880 --> 19:39.980
But if we were doing this, we would do a little something, and then we would do a system call.

19:39.980 --> 19:44.000
We might build something else, print it with a system call.

19:44.060 --> 19:55.620
System calls are relatively expensive, because the computer has to do things, and saving the state of where it is, transferring control to the operating system, and all of that.

19:55.620 --> 19:59.760
Now, I mean, it does this, you know, hundreds of thousands of times a second.

19:59.760 --> 20:02.300
But still, it's a relatively slow process.

20:02.360 --> 20:12.960
But C, the C library does buffering, so it takes all of this stuff, and puts it in memory, and writes it out in one operation.

20:12.960 --> 20:15.560
So, it's a lot more efficient to do that.

20:15.560 --> 20:17.720
So, you know, that standard library is good.

20:17.720 --> 20:24.580
But still, we see how it's doing things like opening files, and things like that.

20:24.580 --> 20:32.620
Um, we mentioned standard in, standard out, and a standard error.

20:32.920 --> 20:37.260
I think we said those files are automatically open for you.

20:37.260 --> 20:43.180
And when we take a look at this, we actually see these numbers in here.

20:43.320 --> 20:52.880
When the standard library goes to open a file, it picks file number three.

20:52.880 --> 20:54.850
Why file number three?

20:55.380 --> 21:04.210
Because zero is always standard in, um, one is always standard out, and two is always standard error.

21:04.860 --> 21:09.280
C knows that, and so it knows where to start picking its files.

21:09.300 --> 21:09.890
Anyway.

21:11.020 --> 21:13.360
So, how to log in.

21:13.360 --> 21:17.740
We're not really going to talk about logging into Linux.

21:17.740 --> 21:19.920
But let's talk about the run levels.

21:19.920 --> 21:24.900
Because the run levels are important for how we do log in.

21:24.900 --> 21:30.700
Whether or not it is, you know, a CLI, you know, a tech screen.

21:30.700 --> 21:32.560
Or whether it's the GUI.

21:32.560 --> 21:34.760
And so there are different run levels.

21:34.760 --> 21:43.480
All the way from shutting down the computer to single user, multi-user, GUI.

21:43.480 --> 21:45.520
And we see run level six.

21:45.520 --> 21:48.860
You can tell the computer, run level six.

21:48.860 --> 21:53.820
And if you have like, um, root privileges, you know what it's going to do?

21:53.960 --> 21:54.740
Reboot.

21:54.740 --> 21:56.600
Because that's what run level six is.

21:56.600 --> 21:58.160
It loads in those scripts.

21:58.380 --> 22:01.700
I say a little something about Ubuntu in here.

22:01.880 --> 22:07.780
Because they do several of the run levels, you know, it's going to be like five.

22:07.780 --> 22:09.520
No matter which one you pick.

22:09.520 --> 22:16.920
Several of them, Debian, Ubuntu, is going to be like, you know, going into, um, into the GUI.

22:18.220 --> 22:20.840
So, what's available in the GUI?

22:20.920 --> 22:22.980
Here is a list of, you know, the different programs.

22:22.980 --> 22:30.180
A lot of the stuff that we would see on a Windows system is there.

22:30.680 --> 22:33.940
Different names of the program, because different people write that.

22:33.940 --> 22:35.280
But they're all free.

22:38.490 --> 22:41.250
Using the terminal, when you go into the CLI.

22:41.250 --> 22:43.970
These are just some of the commands that you would try.

22:43.970 --> 22:47.010
And I'll mention a little something about each one of these.

22:47.010 --> 22:50.270
So, the date command, you know, it's going to tell you the date.

22:50.370 --> 22:53.850
In Windows, you have the date command to give you the date.

22:53.850 --> 22:56.710
The time command to give you the time of day.

22:56.850 --> 23:00.510
That's not exactly the same way it is in Linux.

23:00.510 --> 23:04.390
The date command will give you the time and date.

23:04.490 --> 23:09.750
Because the time command will actually time how long it takes a program to run.

23:09.750 --> 23:12.190
How much time it spends in system space.

23:12.190 --> 23:14.570
How much time it spends in user space.

23:14.570 --> 23:18.910
If you type in time on a Linux system, don't worry.

23:18.910 --> 23:23.810
It's just going to come back and say you didn't put in a program or whatnot.

23:24.110 --> 23:28.030
Uptime tells you how long the computer has been running.

23:28.030 --> 23:33.730
It's a lot easier to find that in Linux than it is to find it in Windows.

23:33.730 --> 23:41.370
Sometimes you have to look on a Windows system and try different things to figure out how long has the server been up.

23:42.070 --> 23:44.030
There are other commands.

23:44.030 --> 23:45.710
Say we have the who command.

23:45.710 --> 23:47.430
You put different options on it.

23:47.430 --> 23:53.390
And by the way, the options, we call those, we might say minus A.

23:53.690 --> 23:56.190
We might want to say like dash A.

23:56.190 --> 24:00.430
But Linux people, they generally say minus or whatnot.

24:00.430 --> 24:01.510
That's okay.

24:02.390 --> 24:06.290
Using the terminal, you can string commands together.

24:06.290 --> 24:07.590
Put in that semicolon.

24:07.590 --> 24:09.290
That's a separator.

24:09.290 --> 24:11.390
Ps for processes.

24:11.390 --> 24:15.610
It's funny how people in Unix just abbreviated stuff.

24:15.610 --> 24:17.190
It's like they don't like to type.

24:17.190 --> 24:21.030
You know, they tend to type very fast, but they have shorthand commands.

24:21.030 --> 24:23.610
And it's all typically in lowercase.

24:23.610 --> 24:27.710
Case matters totally in Linux.

24:27.830 --> 24:29.990
I know, the case can be annoying.

24:30.110 --> 24:32.230
But yeah, it matters.

24:32.230 --> 24:35.570
And so you make sure that you get that exactly correct.

24:38.110 --> 24:40.830
Other things for using the terminal.

24:41.470 --> 24:46.210
Windows, well, Linux has its own help system.

24:46.210 --> 24:48.370
And we call those the man pages.

24:48.690 --> 24:50.550
Man is short for what?

24:50.650 --> 24:51.430
Manual.

24:51.910 --> 24:56.810
So the man pages, just about every command has an entry in it.

24:56.810 --> 24:58.870
You might find a few things that don't.

24:58.870 --> 24:59.690
It's kind of funny.

24:59.690 --> 25:01.370
At that point, you just go Google.

25:01.370 --> 25:05.610
Whoever designed the package, for whatever reason, didn't create a man page.

25:05.610 --> 25:07.210
DF disk free.

25:07.210 --> 25:09.010
And you can give it different options.

25:09.010 --> 25:16.310
I like the minus H option on DF because it gives you what stands for human readable.

25:16.370 --> 25:21.910
So it'll give you the file sizes and KB, MB, and those types of things.

25:21.910 --> 25:27.290
Just whatever is usable at that point for the size of it.

25:27.290 --> 25:28.050
Okay.

25:29.690 --> 25:33.650
So this is how the file system is laid out.

25:33.650 --> 25:35.310
We mentioned forward slash.

25:35.310 --> 25:36.590
And that's root.

25:36.730 --> 25:39.570
A few directories hang off of root.

25:39.570 --> 25:40.770
And we list them here.

25:40.770 --> 25:42.130
For example, the boot.

25:42.130 --> 25:48.230
Remember we were saying when you boot up the system, the kernel and stuff that's in the slash boot directory.

25:48.490 --> 25:54.130
Then we have slash Etsy, or we might call it etc, etc.

25:54.570 --> 25:56.250
Often we call it Etsy.

25:56.250 --> 25:59.090
And you have a number of system configuration files.

25:59.090 --> 26:01.850
Not all of them, but a lot of them there.

26:02.410 --> 26:05.910
Slash home is where you put the home directories.

26:05.910 --> 26:07.970
Generally one for each user.

26:09.230 --> 26:10.650
Slash root.

26:10.650 --> 26:16.570
The root user has his own separate directory, separate from home.

26:16.570 --> 26:18.910
Now why would we want to do that?

26:18.910 --> 26:24.950
Maybe the users might fill up the partition that has the home directories.

26:24.950 --> 26:28.790
Well, you want the root user to still be able to do their thing.

26:28.790 --> 26:30.870
So they're going to be in a different space.

26:30.870 --> 26:33.330
They can be in a different space in the file system.

26:33.830 --> 26:36.710
So we see a number of the different ones that we have.

26:36.710 --> 26:40.970
We have usr, we call it user, user bin.

26:41.010 --> 26:45.030
But we see that user, some people say, well that's where you put user files.

26:45.030 --> 26:47.710
No, that's not exactly what it means.

26:47.710 --> 26:53.570
It comes from a specific term from the Unix system.

26:53.770 --> 26:58.870
But in any event, that is where you have the non-changeable files.

26:58.870 --> 27:02.950
Your programs and things like that will sit someplace.

27:02.950 --> 27:05.130
User bin, bin for binary.

27:05.550 --> 27:08.870
User sbin for super user binary.

27:08.870 --> 27:14.090
You know, programs that perhaps only the root user might use will be sitting there.

27:14.090 --> 27:18.210
You have user lib for your programs and things like that.

27:18.210 --> 27:20.130
And you can have links to these.

27:20.130 --> 27:25.930
For example, bin is actually a symbolic link pointing to user bin.

27:25.930 --> 27:31.210
So that kind of helps to make the system more flexible.

27:31.450 --> 27:36.690
So we have var, which is like variable length files and things.

27:36.690 --> 27:39.590
Your logs and things might go into var.

27:40.650 --> 27:48.910
That forward slash proc is a very interesting directory because it's not actually a file system on disk.

27:48.910 --> 27:50.750
It is something that's simulated.

27:50.750 --> 28:00.470
And what it is, is it takes memory parameters and it puts it like it's a disk file so you can read them and write them.

28:00.470 --> 28:06.830
But those are lots of parameters dealing with the memory and the processes that are running on the computer.

28:06.830 --> 28:10.810
The last one we list here is the sys one.

28:11.490 --> 28:16.410
And that has parameters generally that you can read and set.

28:16.410 --> 28:19.650
And you would change the operation of the kernel.

28:19.650 --> 28:25.830
You can update the parameters of the machine while it's still running.

28:27.750 --> 28:30.850
Here we look at moving around the file system.

28:30.850 --> 28:38.250
And these are just commands to know pwd, print working directory, still like on Microsoft.

28:38.630 --> 28:40.850
They can work a little bit different.

28:41.410 --> 28:46.770
You can list files, ls stands for list, cd for change directory.

28:46.770 --> 28:50.690
If it's a hidden file, we're going to have a dot in front of it.

28:50.690 --> 28:54.210
So a dot in front of a file name means that it's hidden.

28:54.210 --> 28:55.530
How do we see that?

28:55.530 --> 29:01.730
Use the list command ls minus a, you will see those files as well.

29:01.730 --> 29:04.790
I mentioned the dot and the dot dot.

29:04.790 --> 29:07.490
Now Microsoft does this as well.

29:07.510 --> 29:10.990
And the dot is helpful for when you're moving around.

29:10.990 --> 29:14.610
That just means the directory where I am.

29:14.610 --> 29:17.610
Dot dot is the parent directory.

29:17.690 --> 29:22.850
Say for example, you're someplace, you're in home, you know, my directory.

29:22.850 --> 29:24.630
And you want to move up to the home.

29:24.630 --> 29:28.770
You just say change directory cd dot dot and it moves up.

29:28.770 --> 29:35.010
And that is the same as for Microsoft in a lot of cases.

29:36.630 --> 29:39.370
So there are some other things that we use.

29:39.370 --> 29:42.670
And you will see a little bit about this in a little while.

29:42.670 --> 29:46.670
For example, changing the permissions of the file.

29:47.510 --> 29:50.410
They call it change mode in Linux.

29:50.450 --> 29:52.350
Well, you know, that's an interesting one.

29:52.350 --> 29:55.730
Change owner, you can change who owns the file.

29:55.730 --> 30:01.330
The stat command is nice because it gives you a lot of attributes on the file.

30:01.330 --> 30:08.350
You know, the dates, the date when it was created, the date that it was updated, and lots of those.

30:08.350 --> 30:12.990
And other things about, you know, the file pointers and things.

30:12.990 --> 30:17.040
Okay, let's talk a moment about the file permissions.

30:17.570 --> 30:20.770
This is not necessarily difficult.

30:20.770 --> 30:28.590
And I believe that it can be easier than it is for Windows.

30:28.870 --> 30:31.870
So we see a directory.

30:31.870 --> 30:34.830
And in this case, we have some notable people.

30:34.830 --> 30:39.350
There are some very good inventors who have given us a lot of good stuff.

30:39.350 --> 30:44.250
But we see the RW, and that's for read, write.

30:44.250 --> 30:47.010
The third position, we call it execute.

30:47.050 --> 30:48.150
And that repeats.

30:48.150 --> 30:49.490
Read, write, execute.

30:49.490 --> 30:50.770
Read, write, execute.

30:50.770 --> 30:52.690
Why do we have that three times?

30:52.690 --> 30:59.470
The middle of the slide kind of tells us that it's going to be for that user who owns that file.

30:59.470 --> 31:04.510
The group that the file belongs to is always going to belong to a group.

31:04.510 --> 31:08.390
Even if it's the name of the owner, it's going to have a group.

31:08.450 --> 31:09.410
And other.

31:09.410 --> 31:12.890
Other is everybody else in the world who's using the system.

31:12.890 --> 31:16.130
So you can have privileges for that or not.

31:16.230 --> 31:20.710
Below that, I give you a little matrix of how that works out.

31:20.710 --> 31:22.390
We come up with a number.

31:22.390 --> 31:25.710
So if it is a read, we have number four.

31:25.710 --> 31:28.210
If it is a write, number two.

31:28.210 --> 31:31.670
And if it's execute, it's one.

31:31.670 --> 31:36.670
So if they have read, write, execute, it's going to be four plus two plus one.

31:36.990 --> 31:45.030
Now you can change the permissions of the file by using three numbers.

31:45.030 --> 31:46.910
And that will represent all of those.

31:46.910 --> 31:50.530
Whether it'll be anywhere from a zero to a seven for the user.

31:50.650 --> 31:52.950
A zero to seven for the group.

31:52.950 --> 31:55.390
And a zero to seven for the owner.

31:55.450 --> 31:56.970
You can change all of that.

31:56.970 --> 31:59.350
There are other ways that you can do it as well.

31:59.350 --> 32:00.890
And I didn't list those.

32:00.890 --> 32:06.350
It's like you can change a U, a plus this, a plus G, a minus that.

32:06.450 --> 32:11.730
I think it's a lot easier just knowing the numbers and doing that.

32:11.730 --> 32:14.130
So this is something that you'll play with.

32:14.290 --> 32:17.190
Get on there and look at the files and things.

32:17.430 --> 32:22.850
And if you haven't done it, I think you'll find it's not that difficult to do.

32:22.970 --> 32:25.010
Now, so what are the effects of this?

32:25.010 --> 32:33.210
On this slide, we tell you what is affected for changing in a file if you change the read.

32:33.210 --> 32:36.690
And that's pretty obvious, I think.

32:37.230 --> 32:40.970
If they have that permission, that person can read the file.

32:40.970 --> 32:43.510
They don't have it, they can't read the file.

32:43.730 --> 32:45.190
And the same thing for write.

32:45.190 --> 32:53.010
And that execute means if it is a program or a script, whether or not they can run it.

32:53.010 --> 32:56.890
If it's not a script or program, forget about the execute.

32:57.490 --> 33:00.530
So directories have these permissions too.

33:00.750 --> 33:06.990
And they have slightly similar nuanced meanings for directory.

33:06.990 --> 33:08.830
But we list this here as well.

33:09.170 --> 33:13.630
You know, whether you can read a file that's in the directory.

33:13.770 --> 33:17.950
Write is whether you can write to it or delete the file.

33:17.950 --> 33:21.950
Because in any event, you're writing to something in order to delete.

33:21.950 --> 33:25.350
And execute means, can I even get in there?

33:25.610 --> 33:34.470
So by changing these, you can set up a lot of who can get in and see what and do what and what have you.

33:34.470 --> 33:39.710
Now that root user, super user, can get to all sorts of stuff.

33:44.090 --> 33:47.250
So we talked about that proc directory.

33:47.790 --> 33:50.450
Proc is interesting, proc is fun.

33:50.450 --> 33:59.550
First thing about proc, and I did not list here, but for every process that's running, it's going to have a PID, a process ID, a number.

33:59.770 --> 34:03.850
And there is going to be a number there for that process.

34:03.850 --> 34:11.550
If you were to go into that directory of that number, you can see lots of parameters about that process.

34:11.610 --> 34:19.490
Now there are some other things, a lot of things as we list here, that are simply files that you can list in.

34:19.490 --> 34:22.990
And see some things that are going on.

34:22.990 --> 34:24.290
So what are some of these things?

34:24.290 --> 34:25.870
I'll list a few of them.

34:25.970 --> 34:31.250
Now my favorite one is the second one, CPU info.

34:31.330 --> 34:36.230
And that is where you can get detailed information on all of the CPUs.

34:37.970 --> 34:44.050
You can see the strings of the CPU that tells all of their options.

34:44.390 --> 34:48.130
Typically everything is now 64-bit, but it wasn't.

34:48.130 --> 34:57.990
There are some flags in there that will indicate that it's 64-bit, about the type of co-processes and things that it has.

34:58.030 --> 35:06.030
Another thing that is interesting about the CPU info, when you take a look at it, it's going to be kind of odd.

35:06.310 --> 35:11.190
You're going to see multiple CPUs, because every computer nowadays has multiple CPUs.

35:11.190 --> 35:16.050
You're going to see the frequency of the CPU, how fast that thing is running.

35:16.050 --> 35:18.570
Let's say you have eight CPUs.

35:18.570 --> 35:21.090
Here is what you're not going to see.

35:21.130 --> 35:26.230
You're not going to see all of them listing the same exact frequency.

35:26.230 --> 35:29.970
The frequencies of the microprocessors vary a bit.

35:29.970 --> 35:31.810
And they're going to have different numbers.

35:31.810 --> 35:35.670
But in a way, you'll see all of this on CPU info.

35:35.670 --> 35:44.470
When you run commands and things that show you what the CPU is doing, it's pulling it from this file that's in this directory.

35:45.030 --> 35:46.930
The same thing for the other ones.

35:47.210 --> 35:48.250
Meminfo.

35:48.950 --> 35:55.430
All of that gets written to that file as if it is a file on the operating system.

35:55.430 --> 35:56.070
But it's not.

35:56.070 --> 36:02.510
It's a pretty instantaneous spot where you can read and write and whatnot and get all the different versions.

36:03.210 --> 36:12.890
One thing that we're going to say about Linux, and we'll say it a couple of times, is that on a Linux system, everything is a file.

36:12.890 --> 36:15.430
But we'll get to that a little bit more in a moment.

36:15.430 --> 36:16.170
OK.

36:16.170 --> 36:18.150
So command line editing.

36:18.150 --> 36:20.490
Here's the stuff that you'll be using.

36:20.750 --> 36:23.130
You're probably used to a lot of this.

36:23.230 --> 36:25.390
Ctrl-C to end a program.

36:25.410 --> 36:29.470
You can up arrow, down arrow, go back into previous commands.

36:31.010 --> 36:33.350
You know, I forget if Microsoft does this.

36:33.350 --> 36:35.070
Ctrl-S and Ctrl-Q.

36:35.070 --> 36:37.210
Let's say you have a listing that's scrolling.

36:37.210 --> 36:38.950
You know, Ctrl-Q, Ctrl-S.

36:38.950 --> 36:41.110
You know, make it stop, go, stop, go.

36:41.750 --> 36:45.110
We used to do that on terminals, you know, way back in the day.

36:45.590 --> 36:54.390
Ctrl-D is interesting because if you're typing input into a program, say you're building a file from the command line.

36:54.390 --> 36:56.830
I want to put, you know, maybe three or four lines in this.

36:56.830 --> 36:58.890
How do you tell it that you're done with the input?

36:58.890 --> 37:00.090
Ctrl-D.

37:00.230 --> 37:06.290
Ctrl-Z will suspend the file, a file, a program that's running.

37:06.290 --> 37:08.790
And you can go back and resume the program.

37:08.790 --> 37:13.670
You can take programs and you can put it in the foreground, the foreground, and the background.

37:15.830 --> 37:26.790
Something that I list in here that's a little interesting, just to know, in working on Linux, we're used to Ctrl-C, Ctrl-V, you know, copy, paste.

37:26.970 --> 37:33.270
When you're in the CLI, a lot of times you have to do Shift-Ctrl-C, Shift-Ctrl-V.

37:33.270 --> 37:35.770
That's just a little something you get used to.

37:35.770 --> 37:36.330
OK.

37:36.330 --> 37:42.010
So, we mentioned the three files that are associated with every running process.

37:42.010 --> 37:44.510
The standard in, standard out, standard error.

37:44.510 --> 37:48.850
And we see that there are 0, 1, and 2, the file numbers.

37:48.850 --> 37:50.630
They're always going to be that.

37:50.630 --> 38:01.750
So, the input by default is going to be, from the keyboard, the output by default, the user screen, standard error by default, the user screen.

38:02.430 --> 38:07.810
Remember we said in Linux, everything is considered to be a file.

38:08.230 --> 38:14.890
Now, that standard input and output can be redirected to other places.

38:14.890 --> 38:19.310
You can send standard output to a file.

38:19.310 --> 38:22.230
In other words, you get the output just right at the disk somewhere.

38:22.230 --> 38:25.250
Or you can send it into another program.

38:25.250 --> 38:27.330
You can pipe it into another program.

38:27.330 --> 38:30.950
And that becomes its standard in to another program.

38:31.750 --> 38:32.590
OK.

38:33.230 --> 38:36.050
So, everything is a file in Linux.

38:36.050 --> 38:37.550
So, what about Windows?

38:37.550 --> 38:40.650
Windows does not treat this the same.

38:40.650 --> 38:45.670
Windows tends to have APIs, application programming interfaces.

38:45.670 --> 38:47.770
And I mentioned PowerShell applets.

38:47.770 --> 38:55.330
When you use PowerShell, and PowerShell is good to use because, you know, in addition to Windows, I mean, Linux will be working with Windows.

38:55.330 --> 38:58.770
You will see that, as I joke, there are billions of them.

38:58.770 --> 39:05.650
But that is, you know, just a fundamentally different way of doing things between the two operating systems.

39:10.070 --> 39:18.930
So, I mentioned that, well, I listed here that many operations and things can be done by open reading and closing a file.

39:18.930 --> 39:24.930
And I was mentioning the PROC FILE SYSTEM is a good example for doing all of that.

39:30.090 --> 39:35.410
A little bit more on using the terminal because we talked about redirecting stuff.

39:35.410 --> 39:39.670
You know, you see that greater than redirecting, you know, output.

39:39.670 --> 39:43.470
You know, you can say, okay, send it into my output into a file.

39:43.470 --> 39:44.930
You know, I'm listing a directory.

39:44.930 --> 39:46.110
Send it to a file.

39:46.110 --> 39:48.050
You know, I want to keep that output.

39:49.150 --> 39:51.410
You will see the double arrow.

39:51.410 --> 39:55.750
And the difference between that is the single arrow will write the file.

39:55.750 --> 40:01.430
If something is there, it will overlay it, erase it, and, you know, start writing anew.

40:01.430 --> 40:04.310
The double arrow, it will append to the file.

40:04.310 --> 40:06.530
That's the only difference between the two.

40:06.530 --> 40:10.990
The less than sign is you can redirect the input.

40:12.230 --> 40:16.490
So, on this slide, we list a few examples of that.

40:16.490 --> 40:19.290
So , we see we have the PIPE command.

40:19.290 --> 40:23.090
And we have the ampersand, which is used to put something in the background.

40:23.090 --> 40:26.650
And this is where it's good to look at these examples right here.

40:26.790 --> 40:31.030
Because the first one, we see that we run a listing.

40:31.030 --> 40:36.150
And we redirect that to a file.

40:36.330 --> 40:41.230
In terms of redirecting the input, the sort is a very good command.

40:41.230 --> 40:48.990
Because by default, the sort command will look to the standard input for something.

40:49.150 --> 40:51.950
Typically, we're not going to be typing in that.

40:51.950 --> 40:52.950
You know, we can.

40:52.950 --> 40:54.250
But typically, we're not.

40:54.250 --> 40:55.470
It's going to be a file.

40:55.470 --> 40:58.410
So, we redirect the input to a file.

40:58.410 --> 41:00.950
And we can redirect the output.

41:01.110 --> 41:04.470
Because if we don't, sort is just going to list it on the screen.

41:05.090 --> 41:08.690
But, you know, that's a very good example of doing that.

41:08.890 --> 41:12.170
I apologize for the next one where the find is an uppercase.

41:12.170 --> 41:14.750
That uppercase F is not going to work.

41:14.750 --> 41:16.770
That's what happens when you use PowerPoint.

41:16.770 --> 41:18.970
It wants to change each one of those.

41:18.970 --> 41:24.670
But we give an example of the two-in-one operator.

41:24.670 --> 41:32.490
The thing about the two-in-one is that I mentioned standard out, which is file handle one.

41:32.490 --> 41:36.070
And standard error, which is file handle two.

41:36.070 --> 41:37.910
And those are two different things.

41:37.910 --> 41:45.070
And even if they're both going to the screen, they can be separate things.

41:45.070 --> 41:50.370
Or a program might, by default, send those someplace else.

41:50.370 --> 41:55.370
But even if it does, we can combine those into one listing.

41:55.370 --> 41:57.090
A lot of times we don't want to.

41:57.090 --> 41:59.710
But if we need to, we can do that.

41:59.750 --> 42:03.350
So we see a few examples of using that pipe command.

42:03.350 --> 42:05.650
And we use pipe on Windows as well.

42:05.650 --> 42:13.130
But, you know, you can take output and redirect it to another program and do things.

42:13.810 --> 42:17.990
What we're doing in the two examples here is counting something.

42:17.990 --> 42:22.430
When we say who, it's going to give you a list of the people who are logged into the system.

42:22.850 --> 42:24.890
In this case, we want to know how many.

42:24.890 --> 42:28.890
So we pipe that into WC, which is word count.

42:28.910 --> 42:30.370
And we say minus L.

42:30.370 --> 42:34.310
Give us the lines, not the characters, you know, not all of that.

42:34.310 --> 42:36.850
Because word count will give you different numbers.

42:37.330 --> 42:40.350
So minus L will give you just the lines.

42:40.470 --> 42:43.450
The same thing if I want to know how many files are on a disk.

42:43.450 --> 42:44.350
Oh, I'm not on a disk.

42:44.350 --> 42:46.710
In a directory, we will list it.

42:47.510 --> 42:52.050
Use the minus L so we get one thing for each file.

42:52.050 --> 42:54.190
And send that to word count.

42:54.190 --> 42:55.970
We'll get the number of files.

42:55.970 --> 42:59.810
So , there are lots of things that we will use that for.

43:00.490 --> 43:07.510
Now that ampersand, and this is a good example of it, putting something in background.

43:07.630 --> 43:13.330
I like to use gedit, the graphical editor on Linux.

43:13.330 --> 43:20.190
Now if I'm on a command line, and if I say, you know, gedit, hello, whatever the file is.

43:20.590 --> 43:22.090
And just do that.

43:22.090 --> 43:27.350
The problem is, it's going to hang the command line until that command finishes.

43:27.950 --> 43:33.650
And so, if I remember, I will have the ampersand.

43:33.650 --> 43:37.750
And so it's going to star gedit and run that in the background.

43:37.750 --> 43:40.370
And so I get the prompt back in the command.

43:40.370 --> 43:47.790
That's just a little example of something that you might want to run in the background and not tie up the screen.

43:47.790 --> 43:50.830
Many other times you will be using that.

43:51.330 --> 43:53.690
So, what can be a command on Linux?

43:54.090 --> 43:55.090
Lots of things.

43:55.090 --> 43:57.250
A program can be compiled.

43:57.330 --> 44:01.410
It can be an interpreter, say Python, or many other things.

44:01.410 --> 44:02.930
You can even run JavaScript.

44:03.250 --> 44:05.010
So things can be a script.

44:05.530 --> 44:10.910
And they can all look the same and run just like it's, you know, command.

44:10.910 --> 44:15.310
So the command can be a file that is on the disk.

44:15.450 --> 44:17.950
It can also be built into the shell.

44:17.950 --> 44:20.310
We call the shell the command line interpreter.

44:20.310 --> 44:21.870
So it can be built in there.

44:21.870 --> 44:27.250
And we give you an indication of looking at, say, man built-ins.

44:27.250 --> 44:30.870
And you will see the commands that are built into the shell.

44:30.870 --> 44:37.470
For example, if you type ls for list cd, those are not programs sitting on a disk.

44:37.470 --> 44:39.190
They are built into the shell.

44:39.190 --> 44:41.940
But they all run as commands.

44:42.570 --> 44:47.130
So the commands are generally available system-wide.

44:47.210 --> 44:51.230
And they can be in any directory, okay?

44:51.370 --> 44:53.910
Now, you can restrict some of them.

44:53.910 --> 45:00.100
For example, the privileged commands, you know, some people might not be able to run those.

45:00.100 --> 45:06.680
And one of several ways they can be restricted from everybody running them, okay?

45:07.960 --> 45:19.980
If you try to do something on a Linux system and the command is not there, if you're on the internet, oftentimes it'll tell you, well, this is in such and such a package.

45:20.060 --> 45:22.940
You know, install this package and you'll get the command.

45:22.940 --> 45:24.700
So that's pretty helpful.

45:26.000 --> 45:40.800
And if you are the root user, running as a root and you put in something, command that's not there, say tcpdump or something, and it'll say that it's here, do you want me to install it?

45:40.800 --> 45:42.240
And you'll say yes or no.

45:44.500 --> 45:48.300
So Linux and available memory.

45:48.800 --> 45:53.120
Linux attempts to use all of the memory that's on the system.

45:53.120 --> 45:57.560
It tends to make, you know, very good use of it.

45:57.800 --> 46:04.700
Slowly over time, it will allocate memory to buffers and to cache.

46:04.840 --> 46:10.420
Now, the buffers are part of the virtual memory system.

46:10.420 --> 46:17.700
If you start paging, you will use some of the buffers, you know, to move program segments and things.

46:17.700 --> 46:30.660
The cache is simply an area where files and things, you know, you've run files, and it will keep the contents of them in memory.

46:30.660 --> 46:36.900
If you run that file again, then it doesn't have to read the disk.

46:36.900 --> 46:40.460
It'll just read it from the blocks that are in memory.

46:40.460 --> 46:50.380
So what Linux does over time is it slowly takes the spare memory and starts allocating it to the cache and to the buffers.

46:50.380 --> 46:53.520
Now, this is still available memory.

46:53.520 --> 47:02.200
If you load a big program and you need it, it's going to deallocate that in a flash from wherever it put it, and it's available to your program.

47:02.200 --> 47:07.560
So it's not memory that is wasted or unavailable.

47:07.560 --> 47:09.780
It's instantly available.

47:09.780 --> 47:19.860
The adage in Linux, you know, we should use all of the memory is a good thing.

47:20.960 --> 47:27.580
This is just a little example of the cache and the buffers over time.

47:27.720 --> 47:30.020
You know, you'll see that they grow.

47:30.140 --> 47:32.300
Now, why am I mentioning this?

47:32.300 --> 47:37.720
Now, it might not matter as much today, and it still might matter in some cases.

47:37.720 --> 48:00.600
Depending upon the way a Linux program looks at the free memory, you know, what functions are used to read it, it might say that it's low on memory because it's not telling you about the memory that's in the cache and that's in the buffers.

48:00.800 --> 48:06.800
And what would happen a lot of times is that, you know, you would have, you know, servers and things running.

48:07.540 --> 48:16.160
And you see the, well, the memory usage is going up, up, up, past 85% all the way up to 99%.

48:17.000 --> 48:19.120
And what happens at that point?

48:19.120 --> 48:22.400
You know, people start screaming and running and all that type of thing.

48:22.400 --> 48:27.180
And you look at the machine and it's like, no, the machine is not running out of memory.

48:27.180 --> 48:29.660
It's just, you know, it's just allocated this memory.

48:29.660 --> 48:34.020
And so when you say how much memory we have free, it's not telling you all of that.

48:34.020 --> 48:38.640
Now, the commands have changed where you can look at that and see that.

48:38.640 --> 48:41.140
In fact, you've been able to look at that and see that for a while.

48:41.220 --> 48:48.700
But the way that you can go in, you know, with the program to look at that, you know, there is a more modern way of doing it.

48:48.700 --> 48:50.100
And it's not a problem.

48:50.100 --> 48:54.340
But if a program uses the older way, then yeah, that can happen.

48:54.780 --> 49:03.440
And on the GitHub, there is a PDF that we have out there that talks about that.

49:03.440 --> 49:06.300
The programming that looks at that.

49:06.300 --> 49:11.500
But , you know, so when you see the memory going high, it's not necessarily a bad thing.

49:11.500 --> 49:16.040
OK, so compatibility of the different files and things.

49:20.560 --> 49:32.200
So when we have the USB drives and you use one by default, and what I list here is something, sometimes this catches me.

49:32.320 --> 49:34.780
And so it's like, you know, I want to back up something.

49:34.780 --> 49:36.800
And I'm moving it there.

49:36.800 --> 49:39.460
And as soon as it hits four gig, it stops.

49:39.560 --> 49:48.440
Well, that's because it's formatted as FAT32 and a file size is maximum four gigabytes.

49:48.500 --> 49:52.340
Now, you can have lots of space on there, but you just stop there.

49:52.340 --> 49:55.200
And so it's a fairly easy fix for that.

49:55.200 --> 49:57.700
And that is to reformat that drive.

49:57.700 --> 49:58.900
You could do it on Windows.

49:59.420 --> 50:01.720
Format it as EXFAT.

50:02.100 --> 50:07.440
And that's, you know, one of Microsoft's, you know, things, you know, Linux will read it usually.

50:07.440 --> 50:12.400
And if Linux doesn't read it, you can, you know, install the packages so you can read it.

50:12.400 --> 50:21.440
But what that does is to, you know, allow you, you know, allow you to use, you know, the very large USBs, you know, to store things on it.

50:22.520 --> 50:31.940
Also, on this slide, you know, we talk about the file systems of the different systems, the file types of the different systems.

50:31.940 --> 50:37.960
So, in Windows, you know, we see we have FAT32, NTFS, and EXFAT.

50:38.440 --> 50:43.780
When we go to Mac and Linux, they cannot read NTFS.

50:43.780 --> 50:47.340
So, they can read, you know, the FAT, the EXFAT.

50:50.820 --> 50:56.980
So, this slide gets back to some of the other things that we're seeing earlier and that Linux is a modular system.

50:56.980 --> 51:02.980
And we talk about some of the things that are modular in the Linux system.

51:03.800 --> 51:09.240
So, all of these things can be changed out and, you know, set up differently.

51:09.240 --> 51:10.340
You can do that.

51:10.340 --> 51:15.380
Usually, you're not going to do that on your own distribution, but you might.

51:15.380 --> 51:24.680
You can roll your own distribution and you will decide, you know, which kernel version, which type of bootloader that you use.

51:24.680 --> 51:26.640
There are several of those.

51:28.040 --> 51:36.600
The package manager, we talked about that, you know, whether it's going to be Red Hat, whether it's going to be Debian, but you can, you know, select all of these things.

51:37.760 --> 51:43.040
So, Linux and viruses, you know, people say that Linux is more secure.

51:43.040 --> 51:48.440
It might be, and I think that's kind of a debatable type thing on it.

51:48.440 --> 52:02.840
But one thing that I do tell people is that a non-privileged user in Linux typically will not be able to write to as many system areas, as many programs and things.

52:03.060 --> 52:10.840
Unless an organization restricts their Windows computer, people can oftentimes, you know, overlay stuff and whatnot.

52:10.840 --> 52:17.240
And, you know, that's how malware can get attached to the system.

52:17.240 --> 52:26.700
But if it cannot write to, you know, a lot of the directories and things, you know, that kind of cuts down on a lot of that.

52:28.100 --> 52:40.460
We mentioned su and sudo because when you install Linux, you do not necessarily have a root password that you put in there.

52:41.200 --> 52:47.780
Windows... Linux knows the root password, but it does not tell you that by default.

52:47.780 --> 52:55.840
You can get at it, but you're the first user who installed it and you have rights to run that su and sudo.

52:55.840 --> 52:58.000
Su stands for switch user.

52:58.280 --> 53:02.440
And sudo means switch user, do something.

53:02.440 --> 53:04.180
And you can set up files and things.

53:04.180 --> 53:05.660
And we list all of that here.

53:05.660 --> 53:15.120
sudoers that has, you know, the people who can run various, you know, privileged commands on the machine.

53:15.620 --> 53:21.600
I list a very fun and favorite command here, dd.

53:21.600 --> 53:25.280
It's questionable what dd actually stands for.

53:25.280 --> 53:29.440
I think some places like Wikipedia might say disk duplicator.

53:29.440 --> 53:32.920
That's not exactly sure where that comes from.

53:32.920 --> 53:39.680
But dd is very handy because you can copy anything with it.

53:39.700 --> 53:42.140
Everything is treated as a file.

53:42.140 --> 53:45.480
You can copy entire disk with it.

53:45.480 --> 53:48.160
You can backup disk with it.

53:48.160 --> 53:59.360
In the syntax that we have here, we see that we have a disk and we can back it up and we can compress it as we back it up.

53:59.360 --> 54:10.840
Compressing takes a bit longer, but, you know, you can take the contents of, you know, I have a computer here, I believe it's 256 gig SSD.

54:11.160 --> 54:20.920
And, you know, when I run dd on it and back it up and compress it, I think it's about 15% of the size.

54:20.920 --> 54:25.820
So it's a pretty handy command for doing that.

54:25.820 --> 54:28.400
Of course, this works on Windows partitions.

54:28.400 --> 54:32.980
You can backup something, load it, back it up, that type of thing.

54:32.980 --> 54:36.780
Okay, we're getting to the final stretch.

54:36.800 --> 54:43.200
So I list some things that are awkward in Linux, you know, awkward or buggy.

54:43.620 --> 54:56.320
One thing that I will highlight Fedora because you may get caught trying to upgrade and you want to make sure it doesn't get too far behind before you start upgrading.

54:56.320 --> 54:59.100
We just, you know, highlight that.

54:59.660 --> 55:08.820
So in summary, we've listed, you know, how Linux got its start and it came from Linux.

55:08.860 --> 55:15.760
And, you know, you see some of the differences and things between Linux and the Windows systems.

55:15.800 --> 55:18.060
Okay, are there any questions?

55:22.450 --> 55:38.030
Okay, so here is where you can find the slides and other information on GitHub for installing Linux, backing it up, and doing things so you can roll your own installations of that.

55:39.390 --> 55:43.190
And this information is available right now.

55:43.430 --> 55:45.270
So otherwise, I appreciate your time.

55:45.270 --> 55:46.290
Thanks.

