start	end	text
0	2060	All right, thank you all for your patience.
2060	3980	We are about to officially start.
5060	7880	Good afternoon slash morning.
7880	26360	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.
26360	34080	DJ holds a bachelor's and a master's degree in business information systems and currently works in the Washington, D.C.
34080	38570	area helping others navigate complex IT ecosystems.
39240	50980	With decades of experience and a passion for mentoring, DJ has made it his mission to reduce the intimidation factor that often surrounds Linux.
51480	62100	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.
62100	67020	If you ever felt hesitant to dive into the Linux world, this is your chance to change that.
67160	69880	Please join me in welcoming DJ Davis.
80300	81900	Awesome, welcome.
82460	84020	Hey, George.
92210	93110	Well , welcome.
93290	98770	Thank you, everyone, for coming to the Blacks in Cyber sessions and presentations.
98770	103110	And thanks for coming to DEF CON because, you know, we have a lot of fun here.
103190	109230	And hopefully we'll have a lot of fun today as we lose the shock value of Linux.
109230	110730	Are y'all ready to have some fun?
110910	112530	All right, all right, all right.
112650	116250	So let's get started into this.
116250	120010	I'll tell you, well, we see the objectives that we have for this.
120150	122590	So, you know, this is an overview awareness.
122590	125050	We're not going to go into all commands and that kind of stuff.
125050	126090	We're not going to be boring.
126090	134610	But, you know, we're going to talk about the difference, you know, between Microsoft Windows and Linux and what have you.
134610	138190	And look into a few of the features and things of this.
139310	142170	So this is our game plan for today.
142170	144990	We're not going to go heavy into comparing distributions.
144990	147630	Let's say that all of the distributions are good.
147630	151130	You know, you pick the one that you like and then you pick another and another.
151130	153190	Have a lot of fun with this.
153270	158510	So we're going to have installing Linux in the appendix.
158510	161170	You'll be able to go there and see that.
161250	164370	And this slide deck will be on GitHub.
164370	166330	So it's there for you.
166330	169510	Maybe we'll see if we can hold the questions until the end of this.
169510	171130	Just keep this moving.
171130	175370	And my usual disclaimer is that this is not affiliated with work.
175370	176870	You know, these are my ideas.
176950	181190	However, you know, work is like fine, cool with me being here.
183130	185070	You heard a little bit about my background.
185070	186650	We're not going to spend much time with this.
186650	189770	But, you know, just in different areas of computing, whatnot.
189770	195310	And currently, you know, I work in IT security in that sector.
195310	196670	Lots of fun there.
196670	199750	My alma mater, VCU, go Rams.
200350	201420	Pretty good school.
202850	207730	So there are a lot of reasons to learn and to use Linux.
207730	209770	So a lot of them are listed here.
209870	214310	I'll just focus on a few toward the bottom of this.
214410	219490	It's great for learning about, you know, how computers work and using different kinds of languages.
219490	223770	You know, on a small machine, you can load a whole bunch of languages.
223870	225010	I do.
225010	233910	So it's a great operating system to see how, you know, things work into detail.
233910	236410	We'll have a little bit of detail here.
236410	239290	It's good for hardware and software hacking.
239290	242510	So pretty soon, if you're not doing that, you will be.
242770	245670	Linux has a rich set of commands.
245670	246730	I love some of the commands.
246730	248530	I mentioned DD and grep.
248530	253550	For no reason other than that, I think it's a good reason to use Linux.
253550	262950	And essentially, it's a very stable, reliable, and powerful OS that is like a free version of Unix.
263790	265190	Unix, did I say?
265190	267310	So what's special about Unix?
267910	271330	Unix gets into, you know, why Linux is around.
271330	282690	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.
282690	288190	That was the first operating system that came out, and they were able to do that with.
288190	290590	There's a modular design.
290970	292950	That's pretty good for several reasons.
292950	297310	And Linux, or Unix, started with inter-process communication.
297370	302730	Microsoft uses this too, because if you've ever used a command prompt, you use that pipe thing.
302730	307650	Yeah, Microsoft borrowed that from Unix at the time.
307830	311490	You have input and output redirection.
311490	315330	We see that less than, greater than, sign, those types of things.
315490	320290	And there are three files that are opened automatically for each process.
320290	323830	Standard in, standard out, and standard error.
323830	327790	Okay, so this is a partial list of Linux distributions.
327790	329750	You might see your favorite one on the list.
329750	332850	You know, pick any of these or pick other ones.
333850	340310	So, some differences between the commands of Linux and Microsoft.
340310	345690	Yeah, the green Linux shows somewhat on this slide.
346550	355070	But, so basically, we have the clear, C-L-E-A-R, for clearing the screen, versus the C-L-S.
355070	361150	You know, you grow up on that, and you get used to that in Microsoft, the C-L-S.
361190	364230	How we separate parts of a file.
364230	367570	Linux uses the forward slash.
367570	370750	Microsoft uses the backslash.
370750	374450	Then there is that fun thing about null versus null.
374450	383990	It's, you know, N-U-L on Microsoft, and it's dev or device null, N-U-L-L, for Linux.
384310	389010	There are some other differences in this command, in these commands, as you see here.
389470	392810	You know, just how you do different things.
392810	397710	Some of these, the commands might be the same, but the operation might be a little different.
397710	400790	For example, changing a directory CD.
401670	407890	That can work a little bit differently in both of those.
409310	416290	Linux does have a live distribution, and you can run that off of a USB.
416750	420130	I don't think you can do that that often with Microsoft.
420130	426690	Although they do have some type of third-party thing that you can get, buy, or what have you.
426770	431770	One nice thing that Microsoft does have is the pause command.
432890	438870	And on here, we show how you would implement that in Linux.
438870	441390	You know, you use the read command and a few options.
441390	444830	That's here on the slide, and these would be, you know, available.
444830	452710	There are other differences in things, you know, between the two operating systems as we see here.
452710	456270	In Linux, you tend to work more with the command line.
456270	461050	You tend to work more with the GUI in Microsoft.
461850	465950	Linux has a lot of free languages and things that are available.
465950	467430	Not so much.
467430	472090	Well, you do have some in Microsoft.
472970	476430	And so that support is getting a lot better.
478030	486270	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.
486270	495610	Microsoft is going to be, you know, using the PowerShell or using the command prompt.
496210	497780	Some other differences.
497780	506760	The super user account in Linux's root in Microsoft is administrator.
506760	509560	Now, in Microsoft, you can change that.
509560	513520	You cannot change that in Linux.
513660	516020	I wouldn't recommend trying to do that.
516020	520180	You'd have to change a lot of underlying stuff to change that.
520180	523060	And we'll look at the general format of the commands.
523060	528200	It's not too difficult to work with, but there are just some things to be aware of.
528200	530840	So, where did Linux come from?
530840	533540	We outlined this in the slide right here.
533540	535880	And so it began in 1969.
536400	540780	AT&T, Bell Labs, they wanted to come up with a new operating system.
541380	545380	In that same year, coincidentally, Linus Torvos was born.
545480	546600	1969.
546600	558300	So, in the late 1970s, AT&T decided to release Unix for universities and some commercial use.
558300	562700	Before then, it was used only by AT&T.
562740	567780	In 1987, not sure if you heard of this part.
567780	574480	This gentleman named Andrew Tannenbaum wrote an operating system called Minix.
574480	580440	And that kind of mimicked the operation of Unix.
580440	583590	But he had that for educational purposes.
583920	592500	In 1987, he came out with this book here, Operating Systems, that had some of the code in it.
592500	597660	And this book was used by universities and places like that.
597660	603680	I happened to see this book at least a few years later after that.
603680	608500	I was hanging out in the Philippines for a while and I went in a bookstore.
608580	611320	And they had a second printing of that.
611320	614120	And it was a nice book and I purchased it.
614120	615540	It's in my garage someplace.
615540	616440	I looked for it.
616440	618080	I can't find that book.
618080	620000	But it's a nice book to have.
620020	627080	So, in 1988, we have Linus Torvos who attends the University of Helsinki.
627360	630640	He goes away for a little while and starts coming back.
630640	637000	Anyway, Linus gets a copy of the book, the software, and he starts playing with it.
637000	639200	He creates the Linux kernel.
640000	649460	The other notable thing about the Linux kernel is that he changed the license of it to GNU Project.
649460	656180	That way, you'd be able to sell it and whatnot and use it more for commercial use.
656180	660820	That's basically how Linux came about from Unix.
660820	665680	And we had that book about the operating systems.
666160	668200	So, what is Linux?
668200	670980	We're going to talk about what it is, what it's not.
670980	673260	We know that it's an operating system.
673260	674980	Linux has a kernel.
675280	681540	And that kernel is the main thing that Linus Torvos works on.
681620	683960	There are other pieces of it as well.
683960	685970	The system bootloader.
686490	688810	Several different types of bootloaders.
688810	690670	And they're pretty good bootloaders.
691010	691790	Grub.
691790	700010	One nice thing about the Linux bootloaders is that they're good at loading in Microsoft Windows as well.
700010	701350	So, dual boot.
701350	704430	You would tend to put Linux on there first.
704470	707390	So, you have the command line interpreter.
707390	709150	Most of us know about Bash.
709150	712490	You know, it could be any of these other ones we list.
712490	714310	We have the SH shell.
714310	718950	KSH shell, I believe, is for people who do systems development more.
718950	720270	They would like that.
720270	722170	There is the Bourne shell.
722170	723950	Here is why I mentioned all of these.
723950	725590	I mentioned the Bourne shell.
725590	727610	What does Bash stand for?
727630	728310	Bourne.
728310	729270	Again.
729270	730110	Shell.
730110	732070	So, that's how we get Bash.
732070	736810	You can have a graphics interface, you know, the GUI.
736970	739160	And then you have package managers.
739620	743020	It can be typically one of two types of package managers.
743020	745120	You have the Red Hat one.
745120	748020	We have the RPM, the YUM, all of that stuff.
748020	752780	Or it can be typically out of the Debian affair where you have the APT.
752780	755740	So, you tend to have one or the other.
756000	757960	You have startup scripts.
757960	762420	And I mentioned two here because it's going to be one of these two.
762420	766840	You know, the system v, vinit, or the system d.
766840	771320	The system d is, you know, the newer one that you tend to see on most systems.
772160	775080	So, Linux, you have a file system.
775080	780300	And I list ext3, which you probably won't see, ext4.
780300	785880	And there are a number of other ones that btrfs is kind of new.
785940	796820	Also, I decided to list FAT32, FAT64, because when you have things like these flash drives, you know, you're kind of using that.
796840	803760	And Linux has other utilities and things that are involved with it.
806580	809800	So, what the kernel is, what the kernel does.
809800	813600	Basically, it is the central core of the machine.
813600	820580	You know, it allocates the memory, does CPU scheduling, the IO, all of these things that we have here.
820580	830300	And we list some of the kernel features, especially to allocate memory and to allocate the time of the CPU.
830460	833440	Most of our computers now have multiple processes.
833500	836860	So, the kernel schedules that.
836860	840180	And you can see, you know, different processes being used.
840180	842740	Okay, what is not in the kernel?
842740	844340	And I believe this is important.
844680	848360	The command line interpreter is not in the kernel.
848360	850580	The GUI is not in the kernel.
850640	853980	Commands, utility programs, those are not in the kernel.
853980	855420	User programs.
855840	862760	Now, sometimes hardware drivers, file systems, and these other things might not be in the kernel.
862760	866140	They might or they might not be, depending upon what they are.
866140	869100	Some of them can be loadable and unloadable.
869100	872940	And so, those are not, you know, written into the kernel per se.
872940	875000	But the kernel can connect to them.
875000	877580	So, this is the current Linux kernel.
877580	881040	It's out, you know, they update this, you know, pretty often.
884500	893360	This version is out, I believe it was July 27, this latest version came out.
893360	896720	So, where do we find the version of the kernel?
896720	899480	And that's going to be in the slash boot directory.
899480	904520	We're going to look more into the different directories and things in a little bit.
905740	910580	If you're in Linux, you can see it by running the uname command.
910580	912940	And there are different varieties of the command.
912940	917220	You put one switch on it, the minus R, and then you get that little name.
917220	921900	The big switch, minus A, you get all of, you know, where the kernel is.
922200	927240	In terms of the source code of the kernel, we list where that is.
927240	929640	You can go and take a look at it.
929820	935720	Interesting thing about it, I believe it says it's 98 point something percent C code.
935720	939760	And on GitHub, it lists what the other variants of it are.
939760	944880	And by the way, it is very good, very well written C code.
944880	946880	Every time I look at it, I'm envious.
946880	950100	I'm like, I've never seen C look this good.
950100	953460	But yeah, they do a very good job at writing that.
953520	960240	Okay, so here's a little illustration that we have that talks about some of the things that are in the kernel.
960240	964380	And we call this the syscall because, you know, system calls.
964380	967940	So, we see this directory path.
967940	971640	Don't worry, you know, you have copy of the slides.
971760	978200	But this directory path has some of the different files of the system calls.
978200	980240	And I highlight where they are.
980580	987920	It's a little tricky finding these because there is also a file called syscall.h, a header file.
987920	990720	But the files are not really listed in there.
990720	997180	And so, I guess when you're compiling, the kernel is winding through all of this stuff to find it.
997840	1003700	So, the unistd, we have it for 64-bit and 32-bit.
1003700	1009560	These are where we can find the different syscalls of the kernel.
1010020	1015420	So, take a look at a few of these in unist32.
1015580	1017820	I highlight two of them.
1017820	1021600	One is the exit, and that's going to be syscall number one.
1021600	1024820	I highlight the right, syscall number four.
1024820	1026840	You see a few other ones too.
1026840	1028960	You see the open and the close.
1028960	1032300	You see the read in addition to the write.
1032300	1034940	You're wondering, why is DJ mentioning this?
1034940	1036540	Okay, let's go to the next slide.
1036540	1050140	Okay, so, strace is a nice utility that prints out where a program does its system calls.
1050140	1056180	And basically, we run this by saying the program is an assembly language program.
1057440	1058320	HelloASM.
1058320	1061300	And all it does is basically print hello world.
1061320	1062920	Most of us are familiar with that.
1062920	1069820	The first thing that you generally do in a language is find out how you print something, hello world, and you do that.
1069860	1073640	And so, this is the strace of hello world.
1073640	1075820	There is not a whole lot there.
1075880	1079960	And it basically does three system calls.
1079960	1082920	The first one to get in there and start running.
1083180	1085700	The next one, we're going to do a write.
1085700	1089900	And it tells the OS how much it's going to write.
1089900	1091620	And we do an exit.
1091620	1097360	So, I bolded the system calls in red.
1097360	1106000	When you see the assembly program over there, you see how we're moving things into a few registers.
1106000	1107560	And we call the routine.
1107560	1113220	And so, that directly reflects what we see in the strace.
1113220	1116580	So, that's for a little assembly language program.
1116660	1121200	Let's take a look at the one for the C program.
1121260	1124040	And again, don't worry, not an eye exam.
1124040	1126400	You have the slides from this.
1126920	1129600	So, we see a couple of things in here.
1129600	1133640	We see that there are a whole bunch of system calls.
1133780	1140340	One of the reasons why C, like other languages, has a standard library.
1140340	1143120	That standard library does a lot of stuff.
1143120	1148700	Now, don't worry about all the stuff that it does, because this program actually runs quite quickly.
1148700	1150800	You know, a couple of milliseconds.
1151040	1154880	But it does all of these system calls to get things done.
1154960	1162580	One thing that I will say about the standard library that is unique is that it does buffered I-O.
1162580	1164540	Buffered I-O is very good.
1164540	1165420	Here's why.
1165420	1168980	I'll see if I can cursor up to this assembly program for a second.
1169240	1173880	You see, if we're writing this in assembly, we're not going to be doing this often.
1173880	1179980	But if we were doing this, we would do a little something, and then we would do a system call.
1179980	1184000	We might build something else, print it with a system call.
1184060	1195620	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.
1195620	1199760	Now, I mean, it does this, you know, hundreds of thousands of times a second.
1199760	1202300	But still, it's a relatively slow process.
1202360	1212960	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.
1212960	1215560	So, it's a lot more efficient to do that.
1215560	1217720	So, you know, that standard library is good.
1217720	1224580	But still, we see how it's doing things like opening files, and things like that.
1224580	1232620	Um, we mentioned standard in, standard out, and a standard error.
1232920	1237260	I think we said those files are automatically open for you.
1237260	1243180	And when we take a look at this, we actually see these numbers in here.
1243320	1252880	When the standard library goes to open a file, it picks file number three.
1252880	1254850	Why file number three?
1255380	1264210	Because zero is always standard in, um, one is always standard out, and two is always standard error.
1264860	1269280	C knows that, and so it knows where to start picking its files.
1269300	1269890	Anyway.
1271020	1273360	So, how to log in.
1273360	1277740	We're not really going to talk about logging into Linux.
1277740	1279920	But let's talk about the run levels.
1279920	1284900	Because the run levels are important for how we do log in.
1284900	1290700	Whether or not it is, you know, a CLI, you know, a tech screen.
1290700	1292560	Or whether it's the GUI.
1292560	1294760	And so there are different run levels.
1294760	1303480	All the way from shutting down the computer to single user, multi-user, GUI.
1303480	1305520	And we see run level six.
1305520	1308860	You can tell the computer, run level six.
1308860	1313820	And if you have like, um, root privileges, you know what it's going to do?
1313960	1314740	Reboot.
1314740	1316600	Because that's what run level six is.
1316600	1318160	It loads in those scripts.
1318380	1321700	I say a little something about Ubuntu in here.
1321880	1327780	Because they do several of the run levels, you know, it's going to be like five.
1327780	1329520	No matter which one you pick.
1329520	1336920	Several of them, Debian, Ubuntu, is going to be like, you know, going into, um, into the GUI.
1338220	1340840	So, what's available in the GUI?
1340920	1342980	Here is a list of, you know, the different programs.
1342980	1350180	A lot of the stuff that we would see on a Windows system is there.
1350680	1353940	Different names of the program, because different people write that.
1353940	1355280	But they're all free.
1358490	1361250	Using the terminal, when you go into the CLI.
1361250	1363970	These are just some of the commands that you would try.
1363970	1367010	And I'll mention a little something about each one of these.
1367010	1370270	So, the date command, you know, it's going to tell you the date.
1370370	1373850	In Windows, you have the date command to give you the date.
1373850	1376710	The time command to give you the time of day.
1376850	1380510	That's not exactly the same way it is in Linux.
1380510	1384390	The date command will give you the time and date.
1384490	1389750	Because the time command will actually time how long it takes a program to run.
1389750	1392190	How much time it spends in system space.
1392190	1394570	How much time it spends in user space.
1394570	1398910	If you type in time on a Linux system, don't worry.
1398910	1403810	It's just going to come back and say you didn't put in a program or whatnot.
1404110	1408030	Uptime tells you how long the computer has been running.
1408030	1413730	It's a lot easier to find that in Linux than it is to find it in Windows.
1413730	1421370	Sometimes you have to look on a Windows system and try different things to figure out how long has the server been up.
1422070	1424030	There are other commands.
1424030	1425710	Say we have the who command.
1425710	1427430	You put different options on it.
1427430	1433390	And by the way, the options, we call those, we might say minus A.
1433690	1436190	We might want to say like dash A.
1436190	1440430	But Linux people, they generally say minus or whatnot.
1440430	1441510	That's okay.
1442390	1446290	Using the terminal, you can string commands together.
1446290	1447590	Put in that semicolon.
1447590	1449290	That's a separator.
1449290	1451390	Ps for processes.
1451390	1455610	It's funny how people in Unix just abbreviated stuff.
1455610	1457190	It's like they don't like to type.
1457190	1461030	You know, they tend to type very fast, but they have shorthand commands.
1461030	1463610	And it's all typically in lowercase.
1463610	1467710	Case matters totally in Linux.
1467830	1469990	I know, the case can be annoying.
1470110	1472230	But yeah, it matters.
1472230	1475570	And so you make sure that you get that exactly correct.
1478110	1480830	Other things for using the terminal.
1481470	1486210	Windows, well, Linux has its own help system.
1486210	1488370	And we call those the man pages.
1488690	1490550	Man is short for what?
1490650	1491430	Manual.
1491910	1496810	So the man pages, just about every command has an entry in it.
1496810	1498870	You might find a few things that don't.
1498870	1499690	It's kind of funny.
1499690	1501370	At that point, you just go Google.
1501370	1505610	Whoever designed the package, for whatever reason, didn't create a man page.
1505610	1507210	DF disk free.
1507210	1509010	And you can give it different options.
1509010	1516310	I like the minus H option on DF because it gives you what stands for human readable.
1516370	1521910	So it'll give you the file sizes and KB, MB, and those types of things.
1521910	1527290	Just whatever is usable at that point for the size of it.
1527290	1528050	Okay.
1529690	1533650	So this is how the file system is laid out.
1533650	1535310	We mentioned forward slash.
1535310	1536590	And that's root.
1536730	1539570	A few directories hang off of root.
1539570	1540770	And we list them here.
1540770	1542130	For example, the boot.
1542130	1548230	Remember we were saying when you boot up the system, the kernel and stuff that's in the slash boot directory.
1548490	1554130	Then we have slash Etsy, or we might call it etc, etc.
1554570	1556250	Often we call it Etsy.
1556250	1559090	And you have a number of system configuration files.
1559090	1561850	Not all of them, but a lot of them there.
1562410	1565910	Slash home is where you put the home directories.
1565910	1567970	Generally one for each user.
1569230	1570650	Slash root.
1570650	1576570	The root user has his own separate directory, separate from home.
1576570	1578910	Now why would we want to do that?
1578910	1584950	Maybe the users might fill up the partition that has the home directories.
1584950	1588790	Well, you want the root user to still be able to do their thing.
1588790	1590870	So they're going to be in a different space.
1590870	1593330	They can be in a different space in the file system.
1593830	1596710	So we see a number of the different ones that we have.
1596710	1600970	We have usr, we call it user, user bin.
1601010	1605030	But we see that user, some people say, well that's where you put user files.
1605030	1607710	No, that's not exactly what it means.
1607710	1613570	It comes from a specific term from the Unix system.
1613770	1618870	But in any event, that is where you have the non-changeable files.
1618870	1622950	Your programs and things like that will sit someplace.
1622950	1625130	User bin, bin for binary.
1625550	1628870	User sbin for super user binary.
1628870	1634090	You know, programs that perhaps only the root user might use will be sitting there.
1634090	1638210	You have user lib for your programs and things like that.
1638210	1640130	And you can have links to these.
1640130	1645930	For example, bin is actually a symbolic link pointing to user bin.
1645930	1651210	So that kind of helps to make the system more flexible.
1651450	1656690	So we have var, which is like variable length files and things.
1656690	1659590	Your logs and things might go into var.
1660650	1668910	That forward slash proc is a very interesting directory because it's not actually a file system on disk.
1668910	1670750	It is something that's simulated.
1670750	1680470	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.
1680470	1686830	But those are lots of parameters dealing with the memory and the processes that are running on the computer.
1686830	1690810	The last one we list here is the sys one.
1691490	1696410	And that has parameters generally that you can read and set.
1696410	1699650	And you would change the operation of the kernel.
1699650	1705830	You can update the parameters of the machine while it's still running.
1707750	1710850	Here we look at moving around the file system.
1710850	1718250	And these are just commands to know pwd, print working directory, still like on Microsoft.
1718630	1720850	They can work a little bit different.
1721410	1726770	You can list files, ls stands for list, cd for change directory.
1726770	1730690	If it's a hidden file, we're going to have a dot in front of it.
1730690	1734210	So a dot in front of a file name means that it's hidden.
1734210	1735530	How do we see that?
1735530	1741730	Use the list command ls minus a, you will see those files as well.
1741730	1744790	I mentioned the dot and the dot dot.
1744790	1747490	Now Microsoft does this as well.
1747510	1750990	And the dot is helpful for when you're moving around.
1750990	1754610	That just means the directory where I am.
1754610	1757610	Dot dot is the parent directory.
1757690	1762850	Say for example, you're someplace, you're in home, you know, my directory.
1762850	1764630	And you want to move up to the home.
1764630	1768770	You just say change directory cd dot dot and it moves up.
1768770	1775010	And that is the same as for Microsoft in a lot of cases.
1776630	1779370	So there are some other things that we use.
1779370	1782670	And you will see a little bit about this in a little while.
1782670	1786670	For example, changing the permissions of the file.
1787510	1790410	They call it change mode in Linux.
1790450	1792350	Well, you know, that's an interesting one.
1792350	1795730	Change owner, you can change who owns the file.
1795730	1801330	The stat command is nice because it gives you a lot of attributes on the file.
1801330	1808350	You know, the dates, the date when it was created, the date that it was updated, and lots of those.
1808350	1812990	And other things about, you know, the file pointers and things.
1812990	1817040	Okay, let's talk a moment about the file permissions.
1817570	1820770	This is not necessarily difficult.
1820770	1828590	And I believe that it can be easier than it is for Windows.
1828870	1831870	So we see a directory.
1831870	1834830	And in this case, we have some notable people.
1834830	1839350	There are some very good inventors who have given us a lot of good stuff.
1839350	1844250	But we see the RW, and that's for read, write.
1844250	1847010	The third position, we call it execute.
1847050	1848150	And that repeats.
1848150	1849490	Read, write, execute.
1849490	1850770	Read, write, execute.
1850770	1852690	Why do we have that three times?
1852690	1859470	The middle of the slide kind of tells us that it's going to be for that user who owns that file.
1859470	1864510	The group that the file belongs to is always going to belong to a group.
1864510	1868390	Even if it's the name of the owner, it's going to have a group.
1868450	1869410	And other.
1869410	1872890	Other is everybody else in the world who's using the system.
1872890	1876130	So you can have privileges for that or not.
1876230	1880710	Below that, I give you a little matrix of how that works out.
1880710	1882390	We come up with a number.
1882390	1885710	So if it is a read, we have number four.
1885710	1888210	If it is a write, number two.
1888210	1891670	And if it's execute, it's one.
1891670	1896670	So if they have read, write, execute, it's going to be four plus two plus one.
1896990	1905030	Now you can change the permissions of the file by using three numbers.
1905030	1906910	And that will represent all of those.
1906910	1910530	Whether it'll be anywhere from a zero to a seven for the user.
1910650	1912950	A zero to seven for the group.
1912950	1915390	And a zero to seven for the owner.
1915450	1916970	You can change all of that.
1916970	1919350	There are other ways that you can do it as well.
1919350	1920890	And I didn't list those.
1920890	1926350	It's like you can change a U, a plus this, a plus G, a minus that.
1926450	1931730	I think it's a lot easier just knowing the numbers and doing that.
1931730	1934130	So this is something that you'll play with.
1934290	1937190	Get on there and look at the files and things.
1937430	1942850	And if you haven't done it, I think you'll find it's not that difficult to do.
1942970	1945010	Now, so what are the effects of this?
1945010	1953210	On this slide, we tell you what is affected for changing in a file if you change the read.
1953210	1956690	And that's pretty obvious, I think.
1957230	1960970	If they have that permission, that person can read the file.
1960970	1963510	They don't have it, they can't read the file.
1963730	1965190	And the same thing for write.
1965190	1973010	And that execute means if it is a program or a script, whether or not they can run it.
1973010	1976890	If it's not a script or program, forget about the execute.
1977490	1980530	So directories have these permissions too.
1980750	1986990	And they have slightly similar nuanced meanings for directory.
1986990	1988830	But we list this here as well.
1989170	1993630	You know, whether you can read a file that's in the directory.
1993770	1997950	Write is whether you can write to it or delete the file.
1997950	2001950	Because in any event, you're writing to something in order to delete.
2001950	2005350	And execute means, can I even get in there?
2005610	2014470	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.
2014470	2019710	Now that root user, super user, can get to all sorts of stuff.
2024090	2027250	So we talked about that proc directory.
2027790	2030450	Proc is interesting, proc is fun.
2030450	2039550	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.
2039770	2043850	And there is going to be a number there for that process.
2043850	2051550	If you were to go into that directory of that number, you can see lots of parameters about that process.
2051610	2059490	Now there are some other things, a lot of things as we list here, that are simply files that you can list in.
2059490	2062990	And see some things that are going on.
2062990	2064290	So what are some of these things?
2064290	2065870	I'll list a few of them.
2065970	2071250	Now my favorite one is the second one, CPU info.
2071330	2076230	And that is where you can get detailed information on all of the CPUs.
2077970	2084050	You can see the strings of the CPU that tells all of their options.
2084390	2088130	Typically everything is now 64-bit, but it wasn't.
2088130	2097990	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.
2098030	2106030	Another thing that is interesting about the CPU info, when you take a look at it, it's going to be kind of odd.
2106310	2111190	You're going to see multiple CPUs, because every computer nowadays has multiple CPUs.
2111190	2116050	You're going to see the frequency of the CPU, how fast that thing is running.
2116050	2118570	Let's say you have eight CPUs.
2118570	2121090	Here is what you're not going to see.
2121130	2126230	You're not going to see all of them listing the same exact frequency.
2126230	2129970	The frequencies of the microprocessors vary a bit.
2129970	2131810	And they're going to have different numbers.
2131810	2135670	But in a way, you'll see all of this on CPU info.
2135670	2144470	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.
2145030	2146930	The same thing for the other ones.
2147210	2148250	Meminfo.
2148950	2155430	All of that gets written to that file as if it is a file on the operating system.
2155430	2156070	But it's not.
2156070	2162510	It's a pretty instantaneous spot where you can read and write and whatnot and get all the different versions.
2163210	2172890	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.
2172890	2175430	But we'll get to that a little bit more in a moment.
2175430	2176170	OK.
2176170	2178150	So command line editing.
2178150	2180490	Here's the stuff that you'll be using.
2180750	2183130	You're probably used to a lot of this.
2183230	2185390	Ctrl-C to end a program.
2185410	2189470	You can up arrow, down arrow, go back into previous commands.
2191010	2193350	You know, I forget if Microsoft does this.
2193350	2195070	Ctrl-S and Ctrl-Q.
2195070	2197210	Let's say you have a listing that's scrolling.
2197210	2198950	You know, Ctrl-Q, Ctrl-S.
2198950	2201110	You know, make it stop, go, stop, go.
2201750	2205110	We used to do that on terminals, you know, way back in the day.
2205590	2214390	Ctrl-D is interesting because if you're typing input into a program, say you're building a file from the command line.
2214390	2216830	I want to put, you know, maybe three or four lines in this.
2216830	2218890	How do you tell it that you're done with the input?
2218890	2220090	Ctrl-D.
2220230	2226290	Ctrl-Z will suspend the file, a file, a program that's running.
2226290	2228790	And you can go back and resume the program.
2228790	2233670	You can take programs and you can put it in the foreground, the foreground, and the background.
2235830	2246790	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.
2246970	2253270	When you're in the CLI, a lot of times you have to do Shift-Ctrl-C, Shift-Ctrl-V.
2253270	2255770	That's just a little something you get used to.
2255770	2256330	OK.
2256330	2262010	So, we mentioned the three files that are associated with every running process.
2262010	2264510	The standard in, standard out, standard error.
2264510	2268850	And we see that there are 0, 1, and 2, the file numbers.
2268850	2270630	They're always going to be that.
2270630	2281750	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.
2282430	2287810	Remember we said in Linux, everything is considered to be a file.
2288230	2294890	Now, that standard input and output can be redirected to other places.
2294890	2299310	You can send standard output to a file.
2299310	2302230	In other words, you get the output just right at the disk somewhere.
2302230	2305250	Or you can send it into another program.
2305250	2307330	You can pipe it into another program.
2307330	2310950	And that becomes its standard in to another program.
2311750	2312590	OK.
2313230	2316050	So, everything is a file in Linux.
2316050	2317550	So, what about Windows?
2317550	2320650	Windows does not treat this the same.
2320650	2325670	Windows tends to have APIs, application programming interfaces.
2325670	2327770	And I mentioned PowerShell applets.
2327770	2335330	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.
2335330	2338770	You will see that, as I joke, there are billions of them.
2338770	2345650	But that is, you know, just a fundamentally different way of doing things between the two operating systems.
2350070	2358930	So, I mentioned that, well, I listed here that many operations and things can be done by open reading and closing a file.
2358930	2364930	And I was mentioning the PROC FILE SYSTEM is a good example for doing all of that.
2370090	2375410	A little bit more on using the terminal because we talked about redirecting stuff.
2375410	2379670	You know, you see that greater than redirecting, you know, output.
2379670	2383470	You know, you can say, okay, send it into my output into a file.
2383470	2384930	You know, I'm listing a directory.
2384930	2386110	Send it to a file.
2386110	2388050	You know, I want to keep that output.
2389150	2391410	You will see the double arrow.
2391410	2395750	And the difference between that is the single arrow will write the file.
2395750	2401430	If something is there, it will overlay it, erase it, and, you know, start writing anew.
2401430	2404310	The double arrow, it will append to the file.
2404310	2406530	That's the only difference between the two.
2406530	2410990	The less than sign is you can redirect the input.
2412230	2416490	So, on this slide, we list a few examples of that.
2416490	2419290	So , we see we have the PIPE command.
2419290	2423090	And we have the ampersand, which is used to put something in the background.
2423090	2426650	And this is where it's good to look at these examples right here.
2426790	2431030	Because the first one, we see that we run a listing.
2431030	2436150	And we redirect that to a file.
2436330	2441230	In terms of redirecting the input, the sort is a very good command.
2441230	2448990	Because by default, the sort command will look to the standard input for something.
2449150	2451950	Typically, we're not going to be typing in that.
2451950	2452950	You know, we can.
2452950	2454250	But typically, we're not.
2454250	2455470	It's going to be a file.
2455470	2458410	So, we redirect the input to a file.
2458410	2460950	And we can redirect the output.
2461110	2464470	Because if we don't, sort is just going to list it on the screen.
2465090	2468690	But, you know, that's a very good example of doing that.
2468890	2472170	I apologize for the next one where the find is an uppercase.
2472170	2474750	That uppercase F is not going to work.
2474750	2476770	That's what happens when you use PowerPoint.
2476770	2478970	It wants to change each one of those.
2478970	2484670	But we give an example of the two-in-one operator.
2484670	2492490	The thing about the two-in-one is that I mentioned standard out, which is file handle one.
2492490	2496070	And standard error, which is file handle two.
2496070	2497910	And those are two different things.
2497910	2505070	And even if they're both going to the screen, they can be separate things.
2505070	2510370	Or a program might, by default, send those someplace else.
2510370	2515370	But even if it does, we can combine those into one listing.
2515370	2517090	A lot of times we don't want to.
2517090	2519710	But if we need to, we can do that.
2519750	2523350	So we see a few examples of using that pipe command.
2523350	2525650	And we use pipe on Windows as well.
2525650	2533130	But, you know, you can take output and redirect it to another program and do things.
2533810	2537990	What we're doing in the two examples here is counting something.
2537990	2542430	When we say who, it's going to give you a list of the people who are logged into the system.
2542850	2544890	In this case, we want to know how many.
2544890	2548890	So we pipe that into WC, which is word count.
2548910	2550370	And we say minus L.
2550370	2554310	Give us the lines, not the characters, you know, not all of that.
2554310	2556850	Because word count will give you different numbers.
2557330	2560350	So minus L will give you just the lines.
2560470	2563450	The same thing if I want to know how many files are on a disk.
2563450	2564350	Oh, I'm not on a disk.
2564350	2566710	In a directory, we will list it.
2567510	2572050	Use the minus L so we get one thing for each file.
2572050	2574190	And send that to word count.
2574190	2575970	We'll get the number of files.
2575970	2579810	So , there are lots of things that we will use that for.
2580490	2587510	Now that ampersand, and this is a good example of it, putting something in background.
2587630	2593330	I like to use gedit, the graphical editor on Linux.
2593330	2600190	Now if I'm on a command line, and if I say, you know, gedit, hello, whatever the file is.
2600590	2602090	And just do that.
2602090	2607350	The problem is, it's going to hang the command line until that command finishes.
2607950	2613650	And so, if I remember, I will have the ampersand.
2613650	2617750	And so it's going to star gedit and run that in the background.
2617750	2620370	And so I get the prompt back in the command.
2620370	2627790	That's just a little example of something that you might want to run in the background and not tie up the screen.
2627790	2630830	Many other times you will be using that.
2631330	2633690	So, what can be a command on Linux?
2634090	2635090	Lots of things.
2635090	2637250	A program can be compiled.
2637330	2641410	It can be an interpreter, say Python, or many other things.
2641410	2642930	You can even run JavaScript.
2643250	2645010	So things can be a script.
2645530	2650910	And they can all look the same and run just like it's, you know, command.
2650910	2655310	So the command can be a file that is on the disk.
2655450	2657950	It can also be built into the shell.
2657950	2660310	We call the shell the command line interpreter.
2660310	2661870	So it can be built in there.
2661870	2667250	And we give you an indication of looking at, say, man built-ins.
2667250	2670870	And you will see the commands that are built into the shell.
2670870	2677470	For example, if you type ls for list cd, those are not programs sitting on a disk.
2677470	2679190	They are built into the shell.
2679190	2681940	But they all run as commands.
2682570	2687130	So the commands are generally available system-wide.
2687210	2691230	And they can be in any directory, okay?
2691370	2693910	Now, you can restrict some of them.
2693910	2700100	For example, the privileged commands, you know, some people might not be able to run those.
2700100	2706680	And one of several ways they can be restricted from everybody running them, okay?
2707960	2719980	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.
2720060	2722940	You know, install this package and you'll get the command.
2722940	2724700	So that's pretty helpful.
2726000	2740800	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?
2740800	2742240	And you'll say yes or no.
2744500	2748300	So Linux and available memory.
2748800	2753120	Linux attempts to use all of the memory that's on the system.
2753120	2757560	It tends to make, you know, very good use of it.
2757800	2764700	Slowly over time, it will allocate memory to buffers and to cache.
2764840	2770420	Now, the buffers are part of the virtual memory system.
2770420	2777700	If you start paging, you will use some of the buffers, you know, to move program segments and things.
2777700	2790660	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.
2790660	2796900	If you run that file again, then it doesn't have to read the disk.
2796900	2800460	It'll just read it from the blocks that are in memory.
2800460	2810380	So what Linux does over time is it slowly takes the spare memory and starts allocating it to the cache and to the buffers.
2810380	2813520	Now, this is still available memory.
2813520	2822200	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.
2822200	2827560	So it's not memory that is wasted or unavailable.
2827560	2829780	It's instantly available.
2829780	2839860	The adage in Linux, you know, we should use all of the memory is a good thing.
2840960	2847580	This is just a little example of the cache and the buffers over time.
2847720	2850020	You know, you'll see that they grow.
2850140	2852300	Now, why am I mentioning this?
2852300	2857720	Now, it might not matter as much today, and it still might matter in some cases.
2857720	2880600	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.
2880800	2886800	And what would happen a lot of times is that, you know, you would have, you know, servers and things running.
2887540	2896160	And you see the, well, the memory usage is going up, up, up, past 85% all the way up to 99%.
2897000	2899120	And what happens at that point?
2899120	2902400	You know, people start screaming and running and all that type of thing.
2902400	2907180	And you look at the machine and it's like, no, the machine is not running out of memory.
2907180	2909660	It's just, you know, it's just allocated this memory.
2909660	2914020	And so when you say how much memory we have free, it's not telling you all of that.
2914020	2918640	Now, the commands have changed where you can look at that and see that.
2918640	2921140	In fact, you've been able to look at that and see that for a while.
2921220	2928700	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.
2928700	2930100	And it's not a problem.
2930100	2934340	But if a program uses the older way, then yeah, that can happen.
2934780	2943440	And on the GitHub, there is a PDF that we have out there that talks about that.
2943440	2946300	The programming that looks at that.
2946300	2951500	But , you know, so when you see the memory going high, it's not necessarily a bad thing.
2951500	2956040	OK, so compatibility of the different files and things.
2960560	2972200	So when we have the USB drives and you use one by default, and what I list here is something, sometimes this catches me.
2972320	2974780	And so it's like, you know, I want to back up something.
2974780	2976800	And I'm moving it there.
2976800	2979460	And as soon as it hits four gig, it stops.
2979560	2988440	Well, that's because it's formatted as FAT32 and a file size is maximum four gigabytes.
2988500	2992340	Now, you can have lots of space on there, but you just stop there.
2992340	2995200	And so it's a fairly easy fix for that.
2995200	2997700	And that is to reformat that drive.
2997700	2998900	You could do it on Windows.
2999420	3001720	Format it as EXFAT.
3002100	3007440	And that's, you know, one of Microsoft's, you know, things, you know, Linux will read it usually.
3007440	3012400	And if Linux doesn't read it, you can, you know, install the packages so you can read it.
3012400	3021440	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.
3022520	3031940	Also, on this slide, you know, we talk about the file systems of the different systems, the file types of the different systems.
3031940	3037960	So, in Windows, you know, we see we have FAT32, NTFS, and EXFAT.
3038440	3043780	When we go to Mac and Linux, they cannot read NTFS.
3043780	3047340	So, they can read, you know, the FAT, the EXFAT.
3050820	3056980	So, this slide gets back to some of the other things that we're seeing earlier and that Linux is a modular system.
3056980	3062980	And we talk about some of the things that are modular in the Linux system.
3063800	3069240	So, all of these things can be changed out and, you know, set up differently.
3069240	3070340	You can do that.
3070340	3075380	Usually, you're not going to do that on your own distribution, but you might.
3075380	3084680	You can roll your own distribution and you will decide, you know, which kernel version, which type of bootloader that you use.
3084680	3086640	There are several of those.
3088040	3096600	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.
3097760	3103040	So, Linux and viruses, you know, people say that Linux is more secure.
3103040	3108440	It might be, and I think that's kind of a debatable type thing on it.
3108440	3122840	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.
3123060	3130840	Unless an organization restricts their Windows computer, people can oftentimes, you know, overlay stuff and whatnot.
3130840	3137240	And, you know, that's how malware can get attached to the system.
3137240	3146700	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.
3148100	3160460	We mentioned su and sudo because when you install Linux, you do not necessarily have a root password that you put in there.
3161200	3167780	Windows... Linux knows the root password, but it does not tell you that by default.
3167780	3175840	You can get at it, but you're the first user who installed it and you have rights to run that su and sudo.
3175840	3178000	Su stands for switch user.
3178280	3182440	And sudo means switch user, do something.
3182440	3184180	And you can set up files and things.
3184180	3185660	And we list all of that here.
3185660	3195120	sudoers that has, you know, the people who can run various, you know, privileged commands on the machine.
3195620	3201600	I list a very fun and favorite command here, dd.
3201600	3205280	It's questionable what dd actually stands for.
3205280	3209440	I think some places like Wikipedia might say disk duplicator.
3209440	3212920	That's not exactly sure where that comes from.
3212920	3219680	But dd is very handy because you can copy anything with it.
3219700	3222140	Everything is treated as a file.
3222140	3225480	You can copy entire disk with it.
3225480	3228160	You can backup disk with it.
3228160	3239360	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.
3239360	3250840	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.
3251160	3260920	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.
3260920	3265820	So it's a pretty handy command for doing that.
3265820	3268400	Of course, this works on Windows partitions.
3268400	3272980	You can backup something, load it, back it up, that type of thing.
3272980	3276780	Okay, we're getting to the final stretch.
3276800	3283200	So I list some things that are awkward in Linux, you know, awkward or buggy.
3283620	3296320	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.
3296320	3299100	We just, you know, highlight that.
3299660	3308820	So in summary, we've listed, you know, how Linux got its start and it came from Linux.
3308860	3315760	And, you know, you see some of the differences and things between Linux and the Windows systems.
3315800	3318060	Okay, are there any questions?
3322450	3338030	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.
3339390	3343190	And this information is available right now.
3343430	3345270	So otherwise, I appreciate your time.
3345270	3346290	Thanks.
