Something similar to this Q&A, I know that cd
will change current working directory in terminal to a new directory like this:
cd /path/to/new_directory
But I wonder how can I change current working directory only by typing for example:
/path/to/new_directory
followed by Enter, of course. Nothing more.
I just find out that by activating
autocd
shell option, using the following command:then
(from
man bash
, somewhere at the line 5131).So it will actually let me use any directory as a command and will
cd
to it:To make the change permanently, add the following line to the end of your
~/.bashrc
file:This is the default behavior for
zsh
with the Grml config.zsh
is an advanced shell, it has a lot of improvements overbash
, the default shell in Ubuntu.To install zsh, type:
To grab the Grml configuration, run this from your home directory:
Then run
zsh
to start it. If you like it, you can make it your default shell by running the following command: