Hello.
In this lecture you will learn about the TAB autocomplete in Linux.
So let's get started.
So when I'm working at the command line, you can easily mistype a command directory name or a file
name.
In fact, the longer directory reference or a file name, the greater chance you have on mistyping it.
This is where our autocomplete can be a lifesaver.
So the autocomplete allows you to start typing a file name or a directory name and then press a tab
key to have the shell complete it for you.
So, for example, in this case, we have LZ, and as you can see, we have my test file, my test file
two and my very, very 219 lengthy file here.
And so when you write like this, LZ, my here.
And you will shove directories that start with my and underscore.
So when you want to copy here for example.
Yeah so copy my vary or my here and as you can see we have several options.
Whenever I click on the top I'm going through these files here.
So after selecting the tab here and press enter your choosing file and here after that we will, for
example, enter in new file, new file.
And here we copied our my very, very lengthy file to new file here.
So ls ls l here?
And as you can see here, the new file is just created in that time here, as you can see here.
134 So in this example, we typed a CP and then press the tab key or we have the actual type, the my
here my and we press the tab key and then shell autocomplete the rest of the file name.
Of course, the destination directory had to be typed, but still Autocomplete saved the command from
a several potential typographical errors.
So the trick to using the autocomplete is to give the shell enough file name characters so it can distinguish
the desired file from the other files.
For example, if the another file name started with, for example.
Really?
Or let's actually try what we have.
Yeah.
If another file name started with test here, pressing the keyword here or like this ls.
Past and present.
The key word here that starts with t here will show us our potential.
Files that we are searching for.
So instead, you would hear a beep if you don't have anything.
To show you.
So if this happens, you can press the tab key again and the shell shows you.
All the file names started with.
Really?
So this feature allows you to see what needs to be typed for.
Tab autocomplete to work properly.