Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
There's also a seemingly little-known shopt option called autocd. From the man page:
Code:
autocd If set, a command name that is the name of a directory
is executed as if it were the argument to the cd command.
This option is only used by interactive shells.
wow, I should read the bash manual, autocd and cdspell seem to be very useful... But it appears that my function solution also allows for the user typing a partial directory name and hitting enter. If the DIRLIST is crafted well enough with the most important directories listed first, then your option will be a few <enter> keys away...
Then again, if you install the bash-completion scripts, they probably allow you to tab complete a prefix if it's in your CDPATH.
this is a bit off of what you're asking, but the tab key is the auto complete.
if you want to change dir or whatever type the command then the first few characters then hit tab, it will work up/down the directory tree
In the old days of M$-DOS, there was the NCD (Norton Change Directory) utility. Anything of the sort in Linux? Explanatory note: you typed out the name of the directory you wanted to go to, that is, last element of the dir path.
And you were, ipso facto, in that dir. If that was the only one by that name, good. When not, and if that wasn't the intended dir, you typed the same command again and you were in a second dir of that name. If this was the intended dir, good. And so on.
It simply maintained a data base with the whole tree, and updated it when invoked from a newly created dir o by means of an option, NCD/R.
Regards.
In the even before M$-DOS days there was Unix (of which the Linux system is a Unix flavor and Unix had its X-Window System since 1984 and with colors since 1985).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.