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 |
I did not realize shopt was a builtin command.
|
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. |
If you want to learn bash and need material:
http://linux.org.mt/article/terminal http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://www.gnu.org/software/bash/manual/bashref.html http://www.dreaming.org/~giles/bashprompt/ http://www.justlinux.com/nhf/Shells/..._Commands.html http://www.linuxcommand.org/who_what_where_why.php http://theory.uwinnipeg.ca/UNIXhelp/ http://www.tldp.org/guides.html#abs http://www.commandlinefu.com/commands/browse HTH. Good luck. |
autojump
Hi,
I've never tried it, but I grabbed this URL sometime ago, and it seems to do what you want : http://wiki.github.com/joelthelion/autojump/ Regards |
@sebas2: most useful your link. Autojump is tiny and fast. Regards.
@JZL240I-U: thanks for the plentiful documentation. Cheers. |
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 |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 01:13 AM. |