What is command line Tab Completion

Tab Completion

Tab completion allows a user to quickly complete commands or file names once they have typed enough at the prompt to make it unique. If the characters typed are not unique, pressing the Tab key twice displays all commands that begin with the characters already typed.

[root@CentOs ~]# pas<Tab><Tab>

[root@CentOs ~]# pas<Tab><Tab>

Tab completion can be used to complete file names when typing them as arguments ta commands. When Tab is pressed, it will complete the file name as much as it can. Pressing Tab a second time causes the shell to list all of the files that are matched by the current pattern. Type additional characters until the name is unique, then use tab completion to finish off the command line.

[root@CentOs ~]# vi /etc/pa

[root@CentOs ~]# vi /etc/pa

Argument and options can be matched with tab completion for many commands. The useradd command is used by the super user , root, to create additional users on the system. It has many options that can be used to control how that command behaves. Tab completion following a partial option can be used to complete the option without a lot of typing.

[root@CentOs ~]# useradd --<Tab><Tab>

useradd





Tech info

Comments