1 00:00:06,528 --> 00:00:10,195 - All right, let me create this file, users. 2 00:00:11,250 --> 00:00:13,980 And in this file, users, 3 00:00:13,980 --> 00:00:17,556 let me enter all that we need. 4 00:00:17,556 --> 00:00:20,556 (keyboard clacking) 5 00:00:26,460 --> 00:00:28,080 Something like this. 6 00:00:28,080 --> 00:00:30,450 It's all about text patterns here. 7 00:00:30,450 --> 00:00:33,960 And first we are going to use grep 8 00:00:33,960 --> 00:00:36,900 to filter all lines that contain the text, "anna." 9 00:00:36,900 --> 00:00:39,060 So grep anna on users, 10 00:00:39,060 --> 00:00:40,140 and what do we get? 11 00:00:40,140 --> 00:00:40,973 There we go. 12 00:00:40,973 --> 00:00:43,470 And you can see that the text that we were looking for 13 00:00:43,470 --> 00:00:45,330 is indicated in red. 14 00:00:45,330 --> 00:00:48,060 That's the grep --colors option 15 00:00:48,060 --> 00:00:49,800 that has been set as a default option 16 00:00:49,800 --> 00:00:51,390 doing that for us. 17 00:00:51,390 --> 00:00:53,220 So next, we need to use the appropriate tool 18 00:00:53,220 --> 00:00:55,650 to print the last line only from this file. 19 00:00:55,650 --> 00:00:59,700 That will be tail -n on users. 20 00:00:59,700 --> 00:01:00,780 Small detail. 21 00:01:00,780 --> 00:01:02,970 In older versions of tail and head, 22 00:01:02,970 --> 00:01:06,510 you needed tail -n followed by the number 23 00:01:06,510 --> 00:01:08,280 to print the last line, 24 00:01:08,280 --> 00:01:11,340 but in newer versions you don't have to use the -n anymore, 25 00:01:11,340 --> 00:01:14,400 you can just use minus followed by the number. 26 00:01:14,400 --> 00:01:16,230 Next, we print the contents of this file 27 00:01:16,230 --> 00:01:18,360 on the screen in reversed order. 28 00:01:18,360 --> 00:01:19,590 That will be tac. 29 00:01:19,590 --> 00:01:21,060 So tac users, 30 00:01:21,060 --> 00:01:24,900 and there we go, contents of the file in the opposite order. 31 00:01:24,900 --> 00:01:25,733 And that's all.