Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6779421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:22:59+00:00 2026-05-26T16:22:59+00:00

Command completion in bash(1) is quite handy; I like this feature very much. But

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:23:00+00:00Added an answer on May 26, 2026 at 4:23 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a command-line tool that uses sub-commands much like Mercurial, Git, Subversion
The (command line) interface I have in mind is like so: watching FILE+ do
In zsh, I have a function called g which acts like this: with no
I currently have a Bash completion file which completes a single parameter from a
I'm using V8 javascript interpreter on the command line but it has no tab-completion.
I'm possibly just blind, but is there a command line to specify conditional compilation
What command checks if a directory exists or not within a Bash shell script?
Via command line, I usually do this: cp -rRp /path/to/a\_folder/. /path/to/another\_folder This copies just
Which command will executed first,If a stored procedure have individual multiple select commands;
The command get executed without the need of pressing Enter. This can be dangerous

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.