Question: Command completion in `bash(1)` is quite handy; I like this feature very much. But I have a question.

For example, we all have `Documents` and `Downloads` in `$HOME` directory.

So if I input `cd ~` and then press `TAB`, then it will traverse all the directory under `$HOME`. When `Documents` come up and the shell now displays `cd ~/Documents`, I want to go deeper into this directory. For example, there is a `work` directory in `Documents`. My intention is to `cd` to the `work` directory.

So what should I do?

I usually input a `w` then press `TAB`, but when this action repeats too much I found it quite annoying. And sometimes I don't know exactly what files are under this directory.

Do you have any good ideas?
ps: In fact, i met this problem when i was using vim. I input `:e` then `TAB`, it will cycle the subfolders, the only way i found to stop the cycling and enter the next level is input a `/`. So the path has double '/' in the end.

Answer: 
You could switch your shell to ZShell, which allows you to tab through directories without typing the first letter.

For example, you can type

```
cd ~/

```

Pressing `TAB` will bring up a list of all subfolders (like in bash), but pressing `TAB` multiple times will allow you to cycle through the subfolders. Pressing the `->` or `/` key will allow you to start tab-completing inside that directory, and so on.

You can sometimes use `chsh` (man chsh for more info) to change your shell, if it's your own personal machine, or your network might have a special way to change your shell. You might also want to Google for some common `.zshrc` / `.zshenv` settings or migrate your old `.bashrc` / `.cshrc` / `.profile` settings.

Zsh also has ways to set up TAB completion for other tasks, for example, it can TAB complete svn files based on those that aren't already in SVN (for `svn add`). To get these features, add

```
autoload -U compinit
compinit

```

to your .zshrc file. There are plenty more ways to customize your TAB completion in zsh (such as with case-insensitivity, or for arguments to different programs), but if you're interested in those, you can probably find more information than I know by searching.
Like the Jack Toole's zsh suggestion (which is a perfectly fine shell), if you have to use bash, you can stick this in your .bashrc for the same "continue to hit `tab` cycle through possibilities" feature:

```
test -n "$PS1" && bind TAB:menu-complete

```

There's also a project called [bash-completion](https://alioth.debian.org/projects/bash-completion/) that provides a lot of other kinds of completion other than pathname completion.