bd
Navigate to parent directories by name
TLDR
SYNOPSIS
bd [-si] name
DESCRIPTION
bd (back directory) is a bash utility for quickly navigating to a parent directory by name instead of typing multiple `cd ../../../` commands. It searches upward in the current path for a directory whose name matches (matching on the first few letters is enough).If several ancestors share the same name, bd jumps to the closest one (the immediate parent is not considered a match). It is installed as a shell alias so the directory change persists in your shell:
PARAMETERS
-s
Case-sensitive matching (the default alias uses -si for case-insensitive).-i
Case-insensitive matching (no-op when already the default).
WORKFLOW
# Jump up to 'myapp'
bd myapp
# Now in: /home/user/projects/myapp
# Or just the first letters
bd my
# Use a parent path inline without leaving the current directory
cp file.txt `bd projects`
FEATURES
- Prefix matching on parent directory names- Bash completion support (via the bundled completion file)- Closest-match resolution when names repeat in the path
CAVEATS
Requires installation and an alias in your shell config (the alias sources the script so the `cd` sticks). Only walks upward through the current path, not into sibling trees. Built for bash; separate ports exist for zsh and fish. Not available by default on most systems.
HISTORY
bd was created by Vigneshwaran Raveendran (vigneshwaranr) to simplify navigating up directory trees by name.
