Auto complete by hitting TAB does not work in Terminal
There may be situations when you are trying to autocomplete the file and/or directory name by hitting TAB button from keyboard but it is not working as expected. You may wondering why rather than autocompleting (or giving suggestions on multiple matches) the insertion point is just going far and far !
Probably the solution is very simple. The reason for this problem is that you are not on bash. Try to solve using the following methods.
First try to check which shell you are on.
$ echo $SHELL
It should show which shell you are running on. However, if you are privileged user and want to check shell for other users, you may use finger command
$ finger eng
Replace eng with appropriate username. It will show the shell for the user along with other information. finger command is available by default on RedHat like systems but may not available on debian (and its derivatives). Try to install by running the following command:
$ apt-get install finger
Don’t forget to add sudo where necessary.
Now, lets assume the eng is not assigned bash shell and we want to assign it to that user. Find the path of bash by running the following command:
$ which bash
Usually it is in /bin/bash. So assign this shell to the user using the following command. Please note, you must have privilege to do that.
$ sudo usermod eng -s /bin/bash
Don’t forget to replace eng to your actual username and /bin/bash to the real path you found using the `which bash` command.
That’s all. Next time the user ‘eng’ logs in, s/he will see that auto completes are working fine as expected
a WordPress rating system
Related posts:
- Full site backup and restore in Shell
- Secure your Linux Servers
- Removing a directory using XML-API
- cPanel JailShell, Unmount and Clean Virtfs
- Apache configuration (httpd.conf) checking