In Bash, the default behavior of the <kbd>tab</kbd> key (command-line completion) is to list all files and folders, including hidden ones (those starting with a .). To exclude hidden files and folders from tab completion, you can modify the behavior of the readline library, which Bash uses for input handling.
Add the following line to your ~/.bashrc or ~/.bash_profile file to exclude hidden files and folders from tab completion:
bashexport FIGNORE=".??*"
FIGNORE is a shell variable that specifies suffixes to ignore during filename completion..??* matches all hidden files and folders (those starting with a . and followed by at least one more character).Open your ~/.bashrc or ~/.bash_profile file in a text editor:
bashnano ~/.bashrc
or
bashnano ~/.bash_profile
Add the line export FIGNORE=".??*" to the file.
Save the file and exit the editor.
Reload your Bash configuration to apply the changes:
bashsource ~/.bashrc
or
bashsource ~/.bash_profile
Now, when you press <kbd>tab</kbd>, hidden files and folders will not appear in the completion list.
Vibe can make mistakes. Check answers. Learn more