1 00:00:01,420 --> 00:00:01,720 Hello. 2 00:00:01,720 --> 00:00:06,070 In this lecture you will learn about the TAB autocomplete in Linux. 3 00:00:06,070 --> 00:00:07,240 So let's get started. 4 00:00:23,700 --> 00:00:28,320 So when I'm working at the command line, you can easily mistype a command directory name or a file 5 00:00:28,320 --> 00:00:28,590 name. 6 00:00:28,590 --> 00:00:36,480 In fact, the longer directory reference or a file name, the greater chance you have on mistyping it. 7 00:00:39,850 --> 00:00:43,670 This is where our autocomplete can be a lifesaver. 8 00:00:43,690 --> 00:00:50,260 So the autocomplete allows you to start typing a file name or a directory name and then press a tab 9 00:00:50,260 --> 00:00:53,500 key to have the shell complete it for you. 10 00:00:53,530 --> 00:00:58,630 So, for example, in this case, we have LZ, and as you can see, we have my test file, my test file 11 00:00:58,660 --> 00:01:03,460 two and my very, very 219 lengthy file here. 12 00:01:03,580 --> 00:01:10,780 And so when you write like this, LZ, my here. 13 00:01:11,720 --> 00:01:15,950 And you will shove directories that start with my and underscore. 14 00:01:16,100 --> 00:01:19,700 So when you want to copy here for example. 15 00:01:21,870 --> 00:01:27,840 Yeah so copy my vary or my here and as you can see we have several options. 16 00:01:27,840 --> 00:01:32,460 Whenever I click on the top I'm going through these files here. 17 00:01:32,460 --> 00:01:40,650 So after selecting the tab here and press enter your choosing file and here after that we will, for 18 00:01:40,650 --> 00:01:46,350 example, enter in new file, new file. 19 00:01:46,350 --> 00:01:51,810 And here we copied our my very, very lengthy file to new file here. 20 00:01:51,810 --> 00:01:55,860 So ls ls l here? 21 00:01:55,860 --> 00:02:03,270 And as you can see here, the new file is just created in that time here, as you can see here. 22 00:02:03,270 --> 00:02:13,170 134 So in this example, we typed a CP and then press the tab key or we have the actual type, the my 23 00:02:13,620 --> 00:02:19,410 here my and we press the tab key and then shell autocomplete the rest of the file name. 24 00:02:19,410 --> 00:02:26,140 Of course, the destination directory had to be typed, but still Autocomplete saved the command from 25 00:02:26,140 --> 00:02:31,330 a several potential typographical errors. 26 00:02:31,330 --> 00:02:39,130 So the trick to using the autocomplete is to give the shell enough file name characters so it can distinguish 27 00:02:39,130 --> 00:02:41,410 the desired file from the other files. 28 00:02:41,410 --> 00:02:45,220 For example, if the another file name started with, for example. 29 00:02:45,220 --> 00:02:45,790 Really? 30 00:02:45,790 --> 00:02:48,190 Or let's actually try what we have. 31 00:02:48,220 --> 00:02:48,460 Yeah. 32 00:02:48,460 --> 00:02:56,620 If another file name started with test here, pressing the keyword here or like this ls. 33 00:02:57,570 --> 00:02:58,650 Past and present. 34 00:02:58,650 --> 00:03:08,190 The key word here that starts with T here will show us our potential files that we are searching for. 35 00:03:08,280 --> 00:03:12,520 So instead, you would hear a beep if you don't have anything. 36 00:03:12,540 --> 00:03:13,330 To show you. 37 00:03:13,350 --> 00:03:18,720 So if this happens, you can press the tab key again and the shell shows you. 38 00:03:18,750 --> 00:03:21,630 All the file names started with. 39 00:03:21,990 --> 00:03:22,380 Really? 40 00:03:22,380 --> 00:03:28,080 So this feature allows you to see what needs to be typed for. 41 00:03:28,170 --> 00:03:31,350 Tab autocomplete to work properly.