[bash 3.0] avoid typing "cd"
I know in .cshrc if I type "set implicitcd" I can avoid typing
"cd /path/to/dir" and can go to any directory just by typing "/path/to/dir" Is there any similar option I can set in my .bashrc file? |
http://www.gsp.com/cgi-bin/man.cgi?section=1&topic=bash
Looks like you can use shopt -s implicitcd. You probably have to put this in your .bashrc or profile... EDIT: At least I think it works for Bash 3.0. I tried it on my Debian sarge system which has Bash 2.0 and it doesn't have the implicitcd shell option... |
why would you even want this?
|
The only way is to patch the shell, but is it worth to waste time in shell programming only to avoid the 2 milliseconds required to type 'cd'?
|
I would say that that depends on how many times a day you have to type 'CD'. If it's enough times then you might actually be making a saving in the time spent typing directories.
Just depends if your pedantic enough to want to save a total of 500milliseconds by the end of the day. :) |
This is one feature of the csh (of many) that I don't think people appreciate until they use it a lot. But it really is a nice thing, especially since it is almost always the desired action. And if you're walking through a filesystem (with tabs) it just makes sense a lot of the time to not keep typing cd.
|
Quote:
-bash: shopt: implicitcd: invalid shell option name |
Quote:
|
Or, if you are not restricted to using bash, you could try zsh. For my purposes, it is the same as bash, with options bash does not include, such as autocd.
If you enter something that cannot be interpreted as a command, such as a directory path, zsh will automatically cd to that directory. |
All times are GMT -5. The time now is 05:33 AM. |