1 00:00:06,660 --> 00:00:09,030 - All right, so here is the first assignment. 2 00:00:09,030 --> 00:00:10,980 Use the appropriate command to locate 3 00:00:10,980 --> 00:00:12,180 all files on your system 4 00:00:12,180 --> 00:00:14,490 with the size bigger than 100 megabytes 5 00:00:14,490 --> 00:00:16,020 and write the result of that command 6 00:00:16,020 --> 00:00:18,720 to the file /tmp/bigfiles 7 00:00:18,720 --> 00:00:21,930 and create a hard link in the user root home directory 8 00:00:21,930 --> 00:00:23,490 with the name bigfiles that links 9 00:00:23,490 --> 00:00:26,400 to the file created in the previous step. 10 00:00:26,400 --> 00:00:27,903 So how do we do that? 11 00:00:30,570 --> 00:00:33,123 Well, to find files we have to find utility. 12 00:00:34,170 --> 00:00:36,000 We need to find on the entire system. 13 00:00:36,000 --> 00:00:40,983 So find / -size +100M, 14 00:00:43,680 --> 00:00:44,780 let's start with that. 15 00:00:47,730 --> 00:00:48,900 And there we can see files 16 00:00:48,900 --> 00:00:51,363 that are bigger than 100 megabyte. 17 00:00:53,070 --> 00:00:54,270 So that's pretty easy. 18 00:00:54,270 --> 00:00:56,639 We need to write a result of the command to the file. 19 00:00:56,639 --> 00:00:58,080 tmp/bigfiles. 20 00:00:58,080 --> 00:01:00,390 So we can use redirection 21 00:01:00,390 --> 00:01:04,910 on the standard out to write to tmp/bigfiles. 22 00:01:08,430 --> 00:01:11,070 Now you can see that only the standard error is displayed 23 00:01:11,070 --> 00:01:16,070 on screen and tmp/bigfiles has the results that I wanted. 24 00:01:18,210 --> 00:01:19,980 Next we need to create a hard link 25 00:01:19,980 --> 00:01:21,360 in user root home directory 26 00:01:21,360 --> 00:01:23,220 with the name bigfiles that links 27 00:01:23,220 --> 00:01:25,410 to the file created in the previous step. 28 00:01:25,410 --> 00:01:30,410 Hard link is simple ln/tmp/bigfiles, 29 00:01:33,662 --> 00:01:35,310 "bigfiles". 30 00:01:35,310 --> 00:01:37,770 And oh no, I am getting a field to 31 00:01:37,770 --> 00:01:40,470 create hard link, "bigfiles", /tmp/bigfiles 32 00:01:40,470 --> 00:01:43,293 invalid cross-device link, you know what's going on. 33 00:01:44,190 --> 00:01:45,360 This is the system that 34 00:01:45,360 --> 00:01:47,220 that I have used throughout this course 35 00:01:47,220 --> 00:01:52,220 and a TMP directory is on this TMP RAM disk. 36 00:01:53,490 --> 00:01:57,720 So if I'm going to use systemctl disable 37 00:01:57,720 --> 00:02:01,083 minus minus now tmp.mount, 38 00:02:02,670 --> 00:02:04,020 then it is failing. 39 00:02:04,020 --> 00:02:05,670 Does that make sense that it's failing? 40 00:02:05,670 --> 00:02:06,836 Well I think it does. 41 00:02:06,836 --> 00:02:10,110 Lsof on tmp is showing open files. 42 00:02:10,110 --> 00:02:12,693 We have open files including gnome terminal. 43 00:02:13,560 --> 00:02:15,990 Good, let's just do systemctl 44 00:02:15,990 --> 00:02:20,160 disable tmp.mount and reboot. 45 00:02:20,160 --> 00:02:23,280 That's the only way to get rid of the open files anyway. 46 00:02:23,280 --> 00:02:25,953 And after the reboot we can try it again. 47 00:02:27,780 --> 00:02:29,013 Alright, we are back. 48 00:02:31,830 --> 00:02:35,257 Let's verify mount, pipe, grap tmp. 49 00:02:36,240 --> 00:02:41,240 And I see a lot of tmpfs, but not on /tmp. 50 00:02:41,490 --> 00:02:44,890 So that means that I can use my 51 00:02:46,860 --> 00:02:50,310 my find command again to create /tmp/bigfiles 52 00:02:50,310 --> 00:02:51,960 before I've written to the RAM drive. 53 00:02:51,960 --> 00:02:53,910 So that doesn't exist anymore. 54 00:02:53,910 --> 00:02:57,063 And now I can use the ln command again. 55 00:02:58,140 --> 00:02:59,640 And the link is now working. 56 00:02:59,640 --> 00:03:04,640 Shall we verify, ls minus il/tmp/bigfiles? 57 00:03:09,030 --> 00:03:12,480 And big files is showing that they exist. 58 00:03:12,480 --> 00:03:15,270 And here we have the I note number 1809. 59 00:03:15,270 --> 00:03:17,220 These are the same for both of the files 60 00:03:17,220 --> 00:03:19,923 and that means that really it's the same file.