Ubuntu – Automatically cd into directories

bashcommand linedirectory

In the terminal You use cd ../../........ to get to wherever you want,

But I am lazy, I am wondering if it is possible to automatically cd into the directories if the command is simply the directory.

The terminals obviously know it's the directory because you get the output of

$ ../
bash: ../: Is a directory

So is it possible to hijack this message to automatically cd into that directory?

Best Answer

Add shopt -s autocd to your ~/.bashrc.

Also, you might want to run man shopt in terminal for more useful options.