1 00:00:06,879 --> 00:00:11,179 So starting with the find command, a size smaller than 1000 bytes. 2 00:00:11,849 --> 00:00:16,019 Okay, let's go man find and in man find, let's use minus 3 00:00:16,019 --> 00:00:20,190 size to look for what exactly we can do with size. 4 00:00:20,690 --> 00:00:24,464 And there you can see that minus size takes a plus n, a minus n, 5 00:00:24,464 --> 00:00:28,239 or an n where minus n is for less than n. That's what I need. 6 00:00:29,539 --> 00:00:35,286 Can we find more information? I'm using n in the man page to repeat my 7 00:00:35,286 --> 00:00:41,033 last find there. I can see that size N takes a suffix c w b 8 00:00:41,033 --> 00:00:46,780 k uppercase m, uppercase g. Well, we are looking for bytes, so c for bytes. 9 00:00:47,119 --> 00:00:47,579 That makes 1000c. 10 00:00:50,840 --> 00:00:56,454 All right, so sudo find etc type f. I want to 11 00:00:56,454 --> 00:01:02,069 find files only size 1000c. That should be doing it. 12 00:01:02,570 --> 00:01:07,939 Now, before I'm going to work on the second part, I want to verify that what 13 00:01:07,939 --> 00:01:13,310 we get here is accurate. And probably it is. I see a nice list of files. 14 00:01:13,920 --> 00:01:16,900 So we need to copy these to the TMP files pictures. 15 00:01:17,719 --> 00:01:20,019 Aha, TMP files pictures. Do we still have that? 16 00:01:21,040 --> 00:01:24,900 We worked on it in a previous lab, but honestly not sure. 17 00:01:25,480 --> 00:01:29,769 So let's use an mkdir p TMP files pictures. 18 00:01:31,370 --> 00:01:34,069 The directory existed. Well, that is okay. 19 00:01:35,049 --> 00:01:39,515 Now I can repeat my command and use a exec, because exec is what 20 00:01:39,515 --> 00:01:43,980 you use to run a command on the result of the previous find command. 21 00:01:44,700 --> 00:01:49,972 I'm using cp no further specification because we already have files only, so 22 00:01:49,972 --> 00:01:55,245 we don't need any recursive or whatsoever curly braces to refer to the 23 00:01:55,245 --> 00:02:00,517 result of the find command. And we copy to TMP files pictures, and 24 00:02:00,517 --> 00:02:05,790 then we need to close the exec statement using a backslash semicolon. 25 00:02:08,289 --> 00:02:15,194 Now let's check using LS l on TMP files pictures, that is showing all these files and 26 00:02:15,194 --> 00:02:22,099 I don't see one single file with a size bigger than 1,000 bytes. That's exactly as intended. 27 00:02:23,539 --> 00:02:28,419 Next, we need to create a symbolic link to VAR in TMP files. 28 00:02:28,939 --> 00:02:35,610 Well, I would like to go into the TMP files directory and use LN s to make that a symbolic link. 29 00:02:36,469 --> 00:02:41,884 So in a symbolic link we first specify what we want to link and then where we 30 00:02:41,884 --> 00:02:47,300 want to link it. Well, where we want to link it, that's dot for the current directory. 31 00:02:48,169 --> 00:02:54,039 So when I use LS then I can see var in light blue. And if I don't believe the light 32 00:02:54,039 --> 00:02:59,909 blue, I use LS l where we can see that var is pointing to var. That's what we needed. 33 00:03:01,810 --> 00:03:06,479 Then we need to create a compress archive file of the home directory. 34 00:03:07,120 --> 00:03:12,750 I'm not saying where it is. Well, let's create it in the current directory. Why not? 35 00:03:13,680 --> 00:03:18,430 So TAR C, even if it can do without a minus, I like consistency, 36 00:03:18,430 --> 00:03:23,180 so I like putting a minus in front of my command line options. 37 00:03:24,620 --> 00:03:29,219 And then Z for compression, V for verbose, which is showing what is going on. 38 00:03:29,770 --> 00:03:36,045 An F for file and then I call it home tgz, that's 39 00:03:36,045 --> 00:03:42,319 a common extension that is used for tar gzip compressed files. 40 00:03:42,930 --> 00:03:47,240 And next I'm using home to put the home directory in there. 41 00:03:47,939 --> 00:03:53,254 Oh boy, I'm getting a permission denied. Yes, of course I'm user student and as user student, I can't 42 00:03:53,254 --> 00:03:58,569 read the home directories of all these different users, so I really need a sudo in front of it. 43 00:03:59,750 --> 00:04:05,000 So LS L is showing that the home TGZ is 44 00:04:05,000 --> 00:04:10,250 here. Now I need to extract it into TMP archive. 45 00:04:10,810 --> 00:04:14,289 First I'm using MKDIR archive. 46 00:04:14,879 --> 00:04:19,040 What was again? Well, in relative file names, that brings you up one level. 47 00:04:19,620 --> 00:04:24,019 So it will create the directory TMP archive. 48 00:04:24,639 --> 00:04:28,899 And next I can use tar. Let's put a sudo in front of that, by the way. 49 00:04:29,579 --> 00:04:31,199 So sudo tariff. 50 00:04:34,199 --> 00:04:39,154 The file that I want to Extract is Home TGZ&C 51 00:04:39,154 --> 00:04:44,110 Archive, which will extract it in that specific directory. 52 00:04:44,730 --> 00:04:50,985 And now if I use LS archive, we can see that it has a home directory, so that 53 00:04:50,985 --> 00:04:57,240 should be okay for a little bit more visibility. You might want to consider using 3 instead. 54 00:04:57,899 --> 00:05:03,435 Now I do know that I created a lot of stuff that we really don't know, 55 00:05:03,435 --> 00:05:08,970 so let me use an RM minus RF on archive, on etc and on files. 56 00:05:09,769 --> 00:05:15,164 Obviously it's very important that we are using the relative filenames here relative to the 57 00:05:15,164 --> 00:05:20,559 tmp directory, because you don't want to clean up the etc directory by accident. 58 00:05:22,639 --> 00:05:27,959 Oh boy, I'm doing it again. What am I doing again? Well, I'm forgetting the sudo command. 59 00:05:28,579 --> 00:05:33,953 Hey, you might be tempted to to work without sudo and open a root shell. Don't do that, because if 60 00:05:33,953 --> 00:05:39,326 you open a root shell and you do something without thinking it through properly, you risk damaging your entire system. 61 00:05:39,326 --> 00:05:44,699 It's not that bad if you need to repeat the command sudo in front of it. After all.