0:00:00.000,0:00:04.290 Hello. Today we're going to be talking[br]about file organization for a small 0:00:04.290,0:00:10.080 penetration test company. What is a pen[br]test? A pen test is an attack on a 0:00:10.080,0:00:15.240 computer or a network for the purposes[br]of trying to find out what weaknesses 0:00:15.240,0:00:20.789 the device(s) happen to have so that they[br]can be taken care of before the bad guys 0:00:20.789,0:00:27.000 try to attack. Pen tests are conducted[br]with legal written permission by the of 0:00:27.000,0:00:32.460 the owners of the attacked devices. So[br]this company has just started conducting 0:00:32.460,0:00:37.920 penetration tests. They've got five[br]clients so far and they have started to 0:00:37.920,0:00:42.239 create a number of different files for[br]each of the different clients they have. 0:00:42.239,0:00:47.219 For example, a nondisclosure agreement or[br]NDA that pretty much says we won't let 0:00:47.219,0:00:54.360 anybody else other than the owners of[br]the devices know what we found out, so 0:00:54.360,0:01:00.059 we're not going to tell anybody, "Hey, this[br]company has these weaknesses." They have 0:01:00.059,0:01:07.500 the letter with written permission to be able[br]to conduct the tests; this one permission 0:01:07.500,0:01:12.060 is sometimes called informally a[br]"get-out-of-jail-free card." The pen 0:01:12.060,0:01:15.030 testers have been taking notes as[br]they've been conducting the tests and 0:01:15.030,0:01:19.380 they've developed a final report and[br]they have all this documentation on each 0:01:19.380,0:01:26.100 of the different clients. Now at this point, I 0:01:26.100,0:01:30.960 have all the relevant files in a[br]directory that's inside my home 0:01:30.960,0:01:36.090 directory. I'd like to copy all of that[br]information into the directory we happen 0:01:36.090,0:01:45.119 to be in at the moment. The command to[br]copy things is "cp," and because we're 0:01:45.119,0:01:51.509 going to be copying a directory, we're[br]going to throw in the -r. Next, we 0:01:51.509,0:01:55.649 have to say what it is we'd like to copy. We'd like to copy files that are in my 0:01:55.649,0:02:02.280 home directory . The tilde ~ represents the[br]home directory, and I'm going to start 0:02:02.280,0:02:07.320 typing the name of the directory that[br]we'd like to copy. It begins with an 0:02:07.320,0:02:13.890 "f" - it's "files for video". As it happens I[br]only have one particular item in 0:02:13.890,0:02:17.010 my home directory that begins with the[br]letter "f," so I'm going to hit the tab key 0:02:17.010,0:02:23.580 now to autocomplete this relatively long[br]name. I just happened to delete the slash 0:02:23.580,0:02:27.990 that came at the end. When you hit "tab"[br]and you have the name of a 0:02:27.990,0:02:32.070 directory, the name will end with a[br]slash / , so you can keep typing 0:02:32.070,0:02:35.820 additional information. As it happens, I[br]don't wish to type anything else, so I just 0:02:35.820,0:02:40.590 deleted this /. It really doesn't matter[br]whether you have that there or not. I'd like 0:02:40.590,0:02:45.989 to copy that information into our[br]current directory. cp always requires two 0:02:45.989,0:02:51.360 arguments; basically, you're saying, "copy[br]what where": What do I wish to copy? The 0:02:51.360,0:02:57.030 directory "files for video". Where do I[br]want to copy it? Here. A single dot . , as 0:02:57.030,0:03:03.570 you'll recall, represents "Here. The[br]current directory." and if I do an ls 0:03:03.570,0:03:12.810 right now, I can see that I do, in fact,[br]have a "files for video" directory. I'm now 0:03:12.810,0:03:17.910 going to switch into my "files for video,"[br]directory, so I type "cd f" and I 0:03:17.910,0:03:23.040 hit the tab. Now you'll notice that[br]everything that begins with "f" in this 0:03:23.040,0:03:28.890 directory goes on to have an "il" as the next two characters, so Linux was able to 0:03:28.890,0:03:32.940 autocomplete the "il," but it[br]doesn't know at this point: Do I want to 0:03:32.940,0:03:38.190 keep typing "es" for "files"? Do I want to type the "lters" for "filters"? It doesn't know, so I'm going 0:03:38.190,0:03:52.290 to give it an "e" and hit tab. It fills in[br]the "s" for us. If I hit an "f" it'll in the rest of the "for." Hit "v," hit tab again and it fills in the rest of 0:03:52.290,0:03:57.810 "video," so you can see that you can hit[br]tab multiple times. So now my "files for 0:03:57.810,0:04:05.700 video" is my active directory and I'm[br]going to take a look inside it and I see 0:04:05.700,0:04:11.549 that I've got a fair number of files[br]here. Now if we are only ever going to be 0:04:11.549,0:04:15.769 having five clients then everything[br]could stay in one directory, 0:04:15.769,0:04:21.750 but we're starting to realize that -- wait[br]a minute -- we're going to have a whole lot 0:04:21.750,0:04:24.930 more clients coming up, and this[br]directory that we have is just going to be 0:04:24.930,0:04:29.400 getting larger and larger and larger,[br]and it's going to become less and less 0:04:29.400,0:04:34.860 easy to be able to find the files that[br]we would like, so we better come up with 0:04:34.860,0:04:38.820 some sort of an organization so that[br]we'll be able to find the files that we 0:04:38.820,0:04:43.259 wish quickly and easily. There are a[br]couple of different approaches we could 0:04:43.259,0:04:47.940 take with these particular files. One[br]approach -- and the one we're going to be 0:04:47.940,0:04:56.130 using -- looks like this. I've ignored all[br]the directory structure that's not 0:04:56.130,0:05:02.610 relevant to us at the moment. We are in[br]the CIS one forty-one directory. We're 0:05:02.610,0:05:05.729 going to create a directory for all of[br]our pen test information. I'm just 0:05:05.729,0:05:10.620 calling it "PT" for "pen test," and then we're[br]going to have a separate directory for 0:05:10.620,0:05:15.960 each of our different clients. Within[br]each of the client directories, we'll 0:05:15.960,0:05:18.389 have the relevant information -- our[br]get-out-of-jail-free card, our 0:05:18.389,0:05:27.210 non-disclosure agreement, the running[br]notes, and the final pen test report. We 0:05:27.210,0:05:30.960 could have organized things in a different[br]way; instead of organizing by client, we 0:05:30.960,0:05:34.110 could have organized by type of[br]information. So we could have put all of 0:05:34.110,0:05:39.300 our get-out-of-jail free cards in one[br]directory all of our NDAs in another 0:05:39.300,0:05:45.060 directory, and so forth. On both this and[br]the past slide, some details are omitted 0:05:45.060,0:05:51.539 just so that the slides wouldn't get too[br]cluttered. So the client information for 0:05:51.539,0:05:59.780 the notes and the reports[br]directories were omitted here. Up here, 0:05:59.780,0:06:04.110 the information for the specific files[br]underneath client3 and for client5 0:06:04.110,0:06:10.949 have been omitted, but you can[br]extrapolate what they would be. So okay, 0:06:10.949,0:06:16.370 we're going to have to create some[br]directories. We'll start off by creating 0:06:16.370,0:06:22.919 the PT directory for our pen tests. The[br]command to create a directory is mkdir. 0:06:22.919,0:06:28.199 It's pronounced "make dir," but it's[br]spelled mkdir. OK, so we've created our 0:06:28.199,0:06:32.490 pen test directory. You can see I've just[br]executed another ls, and we can see our 0:06:32.490,0:06:37.440 pen test directory PT. Inside this[br]directory, we're going to be creating a 0:06:37.440,0:06:40.639 directory called "client1," 0:06:41.340,0:06:51.270 so [br]mkdirPT /client1 [br]Now when we go to move our files, we can 0:06:51.270,0:06:54.960 shorten their names as well. We no longer[br]have to have "PT" and "client1" as part 0:06:54.960,0:06:59.220 of the name of each of these files[br]because we can get the information that 0:06:59.220,0:07:02.790 it's about a pen test and it's for[br]client one just from our directory 0:07:02.790,0:07:10.050 structure. So the syntax of the command[br]to move files is very similar to the 0:07:10.050,0:07:14.930 syntax of the command for copying. The[br]command for moving is "mv" and it's 0:07:14.930,0:07:27.840 "move what where": What are we going to be moving? We're going to be moving our PT client one's get-out-of-jail-free card. Where are we going to be moving it? We're 0:07:27.840,0:07:32.220 going to be moving it into the PT[br]directory -- inside there into the client1 0:07:32.220,0:07:44.070 sub directory -- and from there we're[br]going to call the file simply GooJFC for 0:07:44.070,0:07:50.729 "get-out-of-jail-free card." We can execute an ls command, and we can see that we no 0:07:50.729,0:07:55.979 longer have the get out of jail free[br]card for client one in our current 0:07:55.979,0:08:04.620 directory. If we do an ls for our PT/client1 directory, you can see that in 0:08:04.620,0:08:13.500 fact we do have the file with the[br]shortened name inside the directory. Now 0:08:13.500,0:08:17.910 we're going to do the same thing for[br]each of our other three client1 files. 0:08:17.910,0:08:28.639 I'm going to use the up arrow to[br]retrieve my most recent mv command and 0:08:28.639,0:08:34.950 I'm using the left arrow and the[br]backspace to move to where I need to be 0:08:34.950,0:08:41.880 and to delete the letters I don't want in[br]here. This is just a quicker way of 0:08:41.880,0:08:49.010 coming up with the command rather than having to type it all again by hand. Up arrow 0:08:50.899,0:09:05.779 notes and report. I'm going to clear the[br]screen screen quickly with the ctrl^L 0:09:05.779,0:09:11.610 keyboard shortcut, and ls shows us that we no longer have client1 0:09:11.610,0:09:20.490 files in the current directory, but if we[br]do a ls of PT/client1, we can see that 0:09:20.490,0:09:26.450 we have all of the files that we had[br]before in our client1 directory. Now 0:09:26.450,0:09:33.390 okay, we're going to go ahead and create[br]a client2 directory mkdir PT/client2 0:09:33.390,0:09:43.290 and we could copy all of the files here individually into that 0:09:43.290,0:09:55.430 directory; so we could, for example, say [br]mv PTclient2GooJFC Pt/client2/GooJFC 0:09:55.430,0:10:39.400 0:10:39.580,0:10:49.450 and we could 0:10:49.450,0:10:54.820 do that similar sort of thing for all of[br]the remaining files. There is, however, a 0:10:54.820,0:11:00.640 faster way to accomplish our task. We[br]could we'd once again start out saying 0:11:00.640,0:11:07.720 mv PTclient2 but now instead[br]of listing an end of each individual 0:11:07.720,0:11:14.500 file we can use an asterisk; the[br]asterisk says, "substitute here any zero 0:11:14.500,0:11:21.400 or more characters," so just in this one[br]phrase [br]PTclient2* 0:11:21.400,0:11:26.770 it's as if here we typed all of the files whose names begin with 0:11:26.770,0:11:36.100 PTclient2 [br]Where do we want to put them? we want to put them in PT/client2 0:11:36.100,0:11:43.810 to let's verify that we did what we[br]wanted to do. ls. We don't see anything 0:11:43.810,0:11:47.977 about client2 in our current directory.[br]ls PT/client2[br]We have all four of out 0:11:51.610,0:11:58.570 client2-related files within our[br]client2 directory. Now, the downside of 0:11:58.570,0:12:06.520 this is that we would need to rename the[br]NDA, the notes, and the report file if we 0:12:06.520,0:12:11.950 so desired to shorten up the names. In[br]the interests of not boring you I'm not 0:12:11.950,0:12:17.200 going to go through and shorten all[br]those right now. In real life we might 0:12:17.200,0:12:22.990 or might not choose to do so. At this[br]point, I'm going to very quickly create 0:12:22.990,0:12:30.340 client three, four, and five directories[br]and put the relevant files into them. So 0:12:30.340,0:12:37.100 mkdir PT/client3 PT/client4 PT/client5 0:12:37.220,0:12:45.379 You can use the "mkdir" command with 0:12:45.379,0:12:53.420 multiple different arguments, so that's[br]just created the client3, client4, and 0:12:53.420,0:13:03.769 client5 directories within our PT[br]directory. I'm now going to move all the 0:13:03.769,0:13:17.810 relevant files for client3 into the[br]client3 directory, client 4 into the client4 directory, and client 5 into the client5 directory.[br]directory if I do a quick LS I can see I 0:13:17.810,0:13:25.600 I don't have any ordinary files inside my[br]current directory; I could do an 0:13:25.600,0:13:34.910 ls PT/client3 PT/client4 PT/client5 [br]if I so desired, but ls actually has a nice 0:13:34.910,0:13:45.589 option of -R [br]The capital R says< "show me a recursive listing." What this 0:13:45.589,0:13:51.470 means is this is saying not only show me[br]what's immediately inside the PT 0:13:51.470,0:13:56.480 directory, but if there are any[br]directories in the PT directory, show me 0:13:56.480,0:14:01.009 their contents and if there are any[br]directories within their contents, show 0:14:01.009,0:14:06.769 its contents all the way down the[br]directory structure. So now we can see 0:14:06.769,0:14:12.439 all at once that the PT directory[br]contains the client1 through client5 0:14:12.439,0:14:18.709 directories and we can see the contents[br]of each of the individual client 0:14:18.709,0:14:26.809 directories. I'll say as an aside that[br]there are ways that you would be able to 0:14:26.809,0:14:32.209 shorten the names to remove the PT[br]client in a fashion that's more 0:14:32.209,0:14:37.009 efficient than just doing it by hand. How you would do that, though, is 0:14:37.009,0:14:41.300 beyond the scope of this discussion. OK, I[br]just cleared the screen again and I'm 0:14:41.300,0:14:48.319 going to cd into the PT directory and[br]make a new directory for a hypothetical 0:14:48.319,0:14:55.190 client six. and I'm going to[br]cd into the client6 directory. One 0:14:55.190,0:14:59.810 command that is very useful if you would[br]just like to create an empty file -- in 0:14:59.810,0:15:02.720 fact it's the command that I use to[br]create all the files we've worked with 0:15:02.720,0:15:10.550 today -- that's the "touch" command. So I[br]could say [br]touch NDA 0:15:10.550,0:15:20.920 and I've created an empty 0 bytes file called NDA. 0:15:23.290,0:15:28.310 I'm going to be switching topics a little[br]bit so that I can talk about a couple of 0:15:28.310,0:15:32.540 other things that I did wish to talk[br]about in this video. So this is not 0:15:32.540,0:15:38.480 directly pentest related, but suppose for[br]some reason you wish to have the 0:15:38.480,0:15:45.440 calendar -- the output of the cal command[br]-- display not on your screen, but put it 0:15:45.440,0:15:53.060 into a file. You can redirect the output[br]of the "cal" command. This is saying, "Don't 0:15:53.060,0:15:56.839 show me the calendar -- the output of the[br]cal command -- on the screen. Instead, put 0:15:56.839,0:16:01.220 it into a file that we're going to call[br]'calendar'." We now have a calendar file, and 0:16:01.220,0:16:06.080 if we use the "cat" command to display the[br]contents of the calendar file, we can see 0:16:06.080,0:16:11.650 that it is in fact the calendar for the[br]month in which I'm recording this video. 0:16:11.650,0:16:17.300 Maybe we'll have another file that's[br]going to show the output of the "date" 0:16:17.300,0:16:24.260 command and we'll just call that file[br]"day," and a cat of day reveals that it 0:16:24.260,0:16:28.670 does in fact give us the output of the[br]date command. Why am I creating these 0:16:28.670,0:16:38.089 files? It's because I'd like to show you[br]something about the mv command that 0:16:38.089,0:16:43.640 also applies to the cp command and is[br]very important. We've seen a couple of 0:16:43.640,0:16:49.760 ways in which the mv or the cp commands[br]can be used. With "copy what where," if "where" 0:16:49.760,0:16:56.210 is the name of a file that does not[br]exist, cp or mv will create a file by 0:16:56.210,0:17:06.990 that name with the contents of the[br]original file. So if i say cp x y then both of them will have 0:17:06.990,0:17:16.109 identical content. If the "where" is the[br]name of a directory, what we saw 0:17:16.109,0:17:19.140 mv command holds true with the cp 0:17:19.140,0:17:23.970 command, that the "copy what where," if the "where" is s directory it will take the 0:17:23.970,0:17:29.490 "what" file specified and it will create a file within 0:17:29.490,0:17:35.610 the specified directory with the[br]contents of that file, so if I said [br]cp x y 0:17:35.610,0:17:40.680 with "y" being the name of a directory,[br]what will result is there's going to be 0:17:40.680,0:17:49.530 a file called y/ x with the x in the x[br]directory containing the same content as 0:17:49.530,0:17:54.870 the original file named x. There's a[br]third possibility, though. The first 0:17:54.870,0:18:01.410 possibility was the "what" was the name of[br]a file that did not yet exist. The second 0:18:01.410,0:18:08.280 possibility was the name of a directory. The third possibility 0:18:08.280,0:18:17.010 is the name of a file that does exist. Suppose we decided to 0:18:17.010,0:18:22.830 take information from "cal" and "date" and[br]put it into a single file. I'm just going 0:18:22.830,0:18:32.000 to call "when". So we can move the contents of our "day" file into a file called "when". 0:18:32.000,0:18:43.050 We no longer have a file called "day." The[br]file called "when" now has the output of 0:18:43.050,0:18:49.530 the date command.Now watch very carefully: this is what I wanted to show you. 0:18:49.530,0:18:56.970 If I type [br]mv calendar when [br]-- "when" is a file that already exists; it 0:18:56.970,0:19:02.370 contains the output of the date command -- [br]this is what's currently in the "when" file. 0:19:02.370,0:19:11.280 I did not get any error messages. mv was[br]perfectly happy to move the contents of 0:19:11.280,0:19:18.520 calendar into the "when" file. An ls command shows again we no longer have 0:19:18.520,0:19:27.970 a "calendar" file, but look at the contents[br]of the "when" file. You see what happened 0:19:27.970,0:19:32.410 in the calendar file, but the information[br]from the output of the "date" file -- what had 0:19:32.410,0:19:37.960 been in the "when" file before we copied[br]the calendar contents into "when" -- that is 0:19:37.960,0:19:46.060 gone, and this is the important caveat: If[br]you're using mv or you're using cp 0:19:46.060,0:19:52.030 and the second argument is the name of a[br]file that exists, that file's original 0:19:52.030,0:19:59.530 contents will be replaced with the[br]contents of whatever was in the first 0:19:59.530,0:20:09.760 argument, so be very careful with cp and[br]mv. OK, so we've created quite a number of 0:20:09.760,0:20:13.690 different files here and I'd like to[br]clean up all the files that we worked 0:20:13.690,0:20:17.410 with today. They're just ones that were[br]created for this video; there's really no 0:20:17.410,0:20:22.510 pen test company. I'm going to clean up[br]the files, so the first thing I'd like to 0:20:22.510,0:20:26.260 do would be to delete the directory that[br]I'm in right now and all of its contents. 0:20:26.260,0:20:33.580 To delete a directory use the "rmdir"[br]command. I'm going to 0:20:33.580,0:20:40.630 try to delete the directory I'm in right[br]now and this period is usually used to 0:20:40.630,0:20:48.210 mean "here". We saw it in an action earlier[br]when we said cp -r cis141 . 0:20:48.210,0:20:56.500 We're saying copy that 0:20:56.500,0:21:03.640 one directory here. Dot (.) is a perfectly[br]valid argument for many commands, but 0:21:03.640,0:21:09.400 it's not valid for the "rmdir" command, and[br]there's a reason for it which you could 0:21:09.400,0:21:13.600 probably figure out on your own if you[br]stopped to think for a moment. If we deleted 0:21:13.600,0:21:19.120 the directory we were in, where would we[br]be? We just got rid of the directory we 0:21:19.120,0:21:24.670 were currently in and we have to be in[br]some directory so rmdir basically 0:21:24.670,0:21:28.300 says you can't delete the directory[br]you're in, so I'm going to go up one 0:21:28.300,0:21:33.809 level and I'm going to try deleting my client6 0:21:33.809,0:21:40.650 directory and rmdir still is not[br]going to be very happy. It's saying the 0:21:40.650,0:21:47.720 directory is not empty; you've got files[br]in it, so we can delete all those files. 0:21:47.720,0:21:59.130 we could type in rm -- the command to[br]delete a file -- client6/NDA and we 0:21:59.130,0:22:09.240 could type in rm client6/when, and[br]now we can try again rmdir client6 0:22:09.240,0:22:15.350 Because we deleted everything inside[br]client6, client6 was an empty directory. 0:22:15.350,0:22:28.080 Because client6 is now an empty directory, 0:22:28.080,0:22:35.010 rmdir we'll go ahead and delete it without any complaints. 0:22:35.010,0:22:40.860 An ls shows us we no longer have a client6[br]directory. Suppose we wish to delete 0:22:40.860,0:22:44.970 client5's directory and the first[br]thing we wanted to do was to delete 0:22:44.970,0:22:50.100 everything that's inside the client5[br]directory. Stop and think a minute to see 0:22:50.100,0:22:54.150 if you can figure out how you could[br]delete everything in there all in one 0:22:54.150,0:23:02.190 line. Just a reminder: the contents of the[br]client5 directory. Well, one thing we 0:23:02.190,0:23:15.200 could do would be to type in[br]rm client5/ this-filename client5/this-filename client5/this-filename 0:23:15.260,0:23:23.730 That would be a lot of typing. Another[br]thing we could do will be to type in 0:23:23.730,0:23:33.960 rm client5/*[br]That removes everything that's inside client5. Now in 0:23:33.960,0:23:38.150 this particular case, that's exactly what[br]we wanted to have happen, but be very 0:23:38.150,0:23:43.110 careful with that asterisk, especially[br]when you're using it in 0:23:43.110,0:23:48.720 with a command such as "rm." If we had[br]had a file in the client5 directory 0:23:48.720,0:23:57.179 that we did, in fact, wish to preserve, it's[br]too late. It's gone, and there is no trash 0:23:57.179,0:24:02.880 bin or recycle bin or anything along[br]those lines from which to be able to 0:24:02.880,0:24:10.620 retrieve the data. It's not there[br]anymore. One thing that we could do -- I'm 0:24:10.620,0:24:18.660 going to go ahead and rmdir client5. With a client4 we could say rm -i client4/* 0:24:18.660,0:24:26.610 What client that -s is saying is 0:24:26.610,0:24:32.190 "Be interactive about your[br]deletions -- ask me, for each individual 0:24:32.190,0:24:37.620 file, "'Do you really wish to remove this?'"[br]I do wish to remove all of them, but 0:24:37.620,0:24:41.700 you can see that this provides a little[br]bit of a safety net to make sure that 0:24:41.700,0:24:47.130 we're really not deleting anything we[br]don't wish to 0:24:47.130,0:24:54.240 have deleted. So now I'm going to go[br]ahead and delete client4, and if we 0:24:54.240,0:24:58.060 wanted, we could do the same things with[br]clients3, client2 and client1, but there's an easier way of doing 0:24:58.060,0:25:11.340 things if you know for a fact that you wish to remove not only the directory,[br]but everything underneath the directory. 0:25:11.340,0:25:16.230 Any ordinary files or directory files[br]inside it any directory files that are 0:25:16.230,0:25:20.340 in directory files, that are inside it[br]all the way down -- you know for a fact you 0:25:20.340,0:25:26.130 wish to get rid of everything. Instead of[br]removing them the rmdir command, 0:25:26.130,0:25:36.210 you can use rm -r. rm -r, as you can see, works even 0:25:36.210,0:25:42.750 if the directory contains data, and it's[br]nice to be able to have both methods of 0:25:42.750,0:25:47.610 being able to delete directories. If you[br]know for 100% certain 0:25:47.610,0:25:51.990 that you do wish to[br]delete not only directory but everything 0:25:51.990,0:25:56.850 underneath it, you can do so with rm -r, but that is very powerful. 0:25:56.850,0:25:59.970 If you have any hesitation whatsoever, if[br]you want to make sure that you're just 0:25:59.970,0:26:06.750 removing empty directories, rmdir is the[br]command for you. I'm going to go up a[br]directory and say rm -r PT 0:26:11.738,0:26:21.660 you'll note that at this point the PT directory contains two[br]subdirectories which in turn contain a 0:26:21.660,0:26:29.790 bunch of different files. all of which[br]are now gone. So what we have seen so far 0:26:29.790,0:26:36.510 today is how you can copy and[br]move the files. You can create an empty file 0:26:36.510,0:26:42.630 with the touch command. We've seen that rmdir will 0:26:42.630,0:26:49.950 remove an empty directory. rm -r will[br]remove a directory that may or may not 0:26:49.950,0:26:55.230 be empty. If you wish to have an[br]interactive way of working with rm, you 0:26:55.230,0:27:01.470 could use -i. We've seen that an asterisk[br]can substitute for 0:27:01.470,0:27:10.320 any zero or more characters, and again[br]the asterisk is extremely powerful but 0:27:10.320,0:27:13.560 you have to be careful with it. The[br]asterisk is an example of what is sometimes called 0:27:13.560,0:27:18.630 a "globbing character." Another globbing[br]character is a question mark, and that 0:27:18.630,0:27:24.270 says, "Substitute exactly one character."[br]Instead of "Substituting here zero 0:27:24.270,0:27:30.390 or more," substitute exactly one. So[br]we've also talked a little bit as an 0:27:30.390,0:27:34.890 aside about what pen testing is and some[br]of the documentation -- not all but some of 0:27:34.890,0:27:38.550 the documentation -- that is involved in[br]pen testing. That was just an added bonus. 0:27:38.550,0:27:45.120 If you have any questions, please do feel[br]free to ask your teacher and do be 0:27:45.120,0:27:49.320 prepared -- if you are one of the Delaware[br]Technical Community College CIS 141 0:27:49.320,0:27:55.470 students for whom this video[br]was created -- do be prepared to come 0:27:55.470,0:28:02.900 into the classroom and to be able[br]to conduct various organizations of 0:28:02.900,0:28:09.360 groups of files. So we've seen one[br]example here. Are there any other 0:28:09.360,0:28:14.909 principles for organizing files? There actually are 0:28:14.909,0:28:20.700 a variety of different tips I'd like to[br]talk about, some of which we've already 0:28:20.700,0:28:26.190 made mention of; others of which we have[br]not. One is when you're organizing files, 0:28:26.190,0:28:32.340 it's a good idea to keep data files[br]separate from application files. One 0:28:32.340,0:28:36.029 reason for this is that data files are[br]going to be backed up much more 0:28:36.029,0:28:40.139 frequently than application files, and by[br]keeping them separate, it makes it easier 0:28:40.139,0:28:43.160 to execute a backup strategy. 0:28:43.160,0:28:53.059 You also want to have consistency in naming conventions for files and for folders or directories. We don't want to have client1 0:28:53.059,0:28:58.470 for one directory and PTclient2 for[br]another and thirdclient for a third. If 0:28:58.470,0:28:58.970 we're using client followed by number, we[br]want to keep that throughout. 0:28:58.970,0:29:07.259 You want your names to be short but descriptive. You don't want to have great big lengthy 0:29:07.259,0:29:11.970 things that, as you saw in our example, can[br]be kind of hard to read and take a while to 0:29:11.970,0:29:18.029 type, so make them fairly short. Use[br]common abbreviations (I used PT for 0:29:18.029,0:29:24.629 "pen test") and if a folder/directory -- I[br]put in "folder" here because these tips 0:29:24.629,0:29:29.940 are not Linux specific, they apply[br]equally to Windows or to any other 0:29:29.940,0:29:35.429 operating system -- but if you do see your[br]container object (whatever it's called) 0:29:35.429,0:29:39.750 start to have too much information and[br]it starts to become unwieldy, create 0:29:39.750,0:29:46.080 subfolders and sub-directories. A few[br]possible ways you can organize things 0:29:46.080,0:29:51.120 are completed versus incomplete, so if[br]you've got different files for different 0:29:51.120,0:29:54.870 projects, when you've finished a[br]particular file -- you've done the work 0:29:54.870,0:29:57.899 that is involved with that file -- you can[br]move it from the "incomplete" to the 0:29:57.899,0:30:03.509 "completed" directory. You might organize[br]things by file type, so you'll have all of 0:30:03.509,0:30:06.899 your workbooks together, all your[br]documents in a separate directory, all of 0:30:06.899,0:30:13.200 your slideshows in a third. You might[br]wish to organize things by project -- that 0:30:13.200,0:30:16.710 is, in essence, what we did here -- where we[br]had client1, client2, client3, and 0:30:16.710,0:30:24.000 each client involved a separate pen test.[br]If you're dealing with Windows, 0:30:24.000,0:30:27.810 put your documents in the document folder, create subfolders within the "Document" folder. 0:30:27.810,0:30:34.320 You can use jump lists. I'm going[br]to be panning down on my screen so that 0:30:34.320,0:30:41.370 you can see my taskbar so I can[br]demonstrate a jump list. If I right-click 0:30:41.370,0:30:50.310 on one of the icons in the taskbar, what[br]shows up is a jump list. These are my 0:30:50.310,0:30:55.170 pinned items, these are ones that are[br]going to be staying on my list even if I 0:30:55.170,0:31:03.810 haven't happened to use them in a while. [br]these are files that I've recently used. As I 0:31:03.810,0:31:09.270 added new files, open up new files, the[br]older ones will drop from the list. If 0:31:09.270,0:31:14.340 I'd like to make sure that something[br]stays on this list, I can pin it by 0:31:14.340,0:31:19.620 clicking on the pushpin. I can unpin[br]a pinned item by clicking on the push pin 0:31:19.620,0:31:27.510 again. You might wish use the recent[br]items on the start menu, but if for security 0:31:27.510,0:31:30.990 reasons you don't wish to have a "recent[br]items" on the start menu or you don't 0:31:30.990,0:31:35.750 wish to have a jump list, there[br]are ways of getting rid of those as well. 0:31:35.750,0:31:42.360 If you have certain files that you open[br]very, very, very frequently, you might wish 0:31:42.360,0:31:46.650 to create a desktop shortcut in[br]Windows to the particular item. That way, 0:31:46.650,0:31:52.680 you can go to it directly without having[br]to navigate the folder structure. If you 0:31:52.680,0:31:58.710 are trying to find particular files, you[br]can go into "computer" and for our 0:31:58.710,0:32:02.220 discussion right now. I'd actually like[br]to talk a little bit about how things 0:32:02.220,0:32:09.960 are set up at Del Tech. We have a u: drive[br]that teachers can add information to or 0:32:09.960,0:32:14.130 make changes to. Students can look at and can copy files from it, but they're not 0:32:14.130,0:32:18.510 allowed to make changes. I think the[br]u: drive is an excellent example of 0:32:18.510,0:32:23.610 organization. Even if you've never looked[br]at the u: drive before, if you know that 0:32:23.610,0:32:28.020 this video is for our CIS 141[br]class, you'd be able to just glance at 0:32:28.020,0:32:31.620 the names of these folders. They're very[br]short but they're descriptive. You should 0:32:31.620,0:32:36.420 be able to figure out that this is the folder[br]that you would be interested in. If you 0:32:36.420,0:32:40.400 happen to know[br]that my last name is "Mancini," you'd be 0:32:40.400,0:32:45.530 able to look at these and you'd be able[br]to zero in on exactly which folder would 0:32:45.530,0:32:52.970 have information that is relevant, and[br]then from here again you can go into the 0:32:52.970,0:32:58.820 relevant folder. At this point, I'd like[br]to look at the folder that just says 0:32:58.820,0:33:03.050 "Windows." This contains a number[br]of miscellaneous files for the purposes 0:33:03.050,0:33:10.190 of practicing organization. Again,[br]this is a relatively small number of 0:33:10.190,0:33:14.150 files in this folder, but pretend that[br]there were quite a number and we wish to 0:33:14.150,0:33:20.120 find a particular one. I happen to be in[br]the "Details" view right now. You can 0:33:20.120,0:33:25.010 change your view by going to the View[br]menu. You're going to "Details." If you 0:33:25.010,0:33:29.660 don't happen to see your view menu, you[br]could go to the drop-down list for 0:33:29.660,0:33:37.340 "Organize," and choose "Layout," and you'll be able to see your menu bar, then you can 0:33:37.340,0:33:42.200 bring up the View menu. We're[br]currently in the details view now. The 0:33:42.200,0:33:46.670 nice thing about the details view -- or one[br]of the nice things beyond the fact that 0:33:46.670,0:33:50.120 it gives you a lot more information[br]about all the different files -- is that 0:33:50.120,0:33:54.140 you can organize things quickly. If you[br]knew that the file you were interested 0:33:54.140,0:33:59.150 in was one that had been modified fairly[br]recently, you can click on "Date Modified," 0:33:59.150,0:34:04.970 and if you click on it once, it organizes[br]things from the most recently to the 0:34:04.970,0:34:08.659 least recently modified files. These[br]files haven't been modified in quite a 0:34:08.659,0:34:14.690 while. If you click on it again, it[br]reverses the organization. If you knew 0:34:14.690,0:34:18.500 that you wished to get rid of some files --[br]maybe you're running out of space -- and 0:34:18.500,0:34:21.649 you wanted to see if are there a couple of[br]really large files that you wish to get 0:34:21.649,0:34:29.210 rid of, you could sort by size. The[br]default order is sorting by name, and if 0:34:29.210,0:34:33.859 you happen to have a mixture of both[br]files and folders, the folders by default 0:34:33.859,0:34:39.800 will show up first a through , then the[br]ordinary files a through z. So, again, I 0:34:39.800,0:34:44.179 hope you found these tips useful. Keep[br]them in mind. Again, if you happen to be a 0:34:44.179,0:34:49.040 CIS 141 student at Delaware[br]Technical Community College, be sure to 0:34:49.040,0:35:01.490 practice the commands that we discussed[br]earlier in this video: cp, mv, touch, the ls with the -R option, rmdir, rm -r, the 0:35:01.490,0:35:08.830 -i option, rm without any options. Practice the globbing 0:35:08.830,0:35:17.240 character, the asterisk. Be prepared to[br]come into class and be able to do 0:35:17.240,0:35:21.980 something similar to what was done in[br]this particular presentation.You will be 0:35:21.980,0:35:27.920 given a directory that has a lot of[br]files, and that you are going to have to try 0:35:27.920,0:35:33.230 to come up with an appropriate[br]organization for. Again, I hope you found 0:35:33.230,0:35:37.730 this video interesting and useful and[br]informative. If you have any questions, 0:35:37.730,0:35:41.170 please do speak with your instructor