bd(1)
π bd β the manual page, but make it make sense π
bd(1) β quickly go back to a specific parent directory in bash. yes bestie, that's the whole vibe. π¦
β¨ NAME β¨
bd β quickly go back to a specific parent directory in bash π
β¨ SYNOPSIS β¨
(okay so the original page literally leaves this section empty, and I am not about to invent options for you β the good stuff is all in DESCRIPTION. slay. π )
β¨ DESCRIPTION β¨
bd lets you jump to a parent directory in bash instead of typing cd ../../.. over and over again like some kind of tragic little gremlin. no cap, the redundancy was giving pain. π
You can just type bd with the first few letters of the directory and it will auto complete the directory name for you. so easy. so iconic. β¨
It plays nicely with other commands too β think ls, ln, echo, zip, tar, etc. it's giving main character energy that shares the spotlight. π
β¨ OPTIONS β¨
-siβ you don't have to type the full directory name (meaning "starts with"), just give the starting few characters and let it do the rest. lowkey magical. π§-.β turns on case-sensitive directory name matching. fr fr, capital letters matter now. π₯
πΈ NOTES πΈ
So to avoid having to use . and -si/-. every single time, you can add the line below into your .bashrc file:
echo 'alias bd=". bd -si"' >> ~/.bashrc
And then, do this:
source ~/.bashrc
and boom, you're living the dream. π
π¦ OTHER USES π¦
Using bd inside backticks (`bd <letter(.)>`) prints out the path without changing the current directory. it's just showing you the address, not moving you in. π
You can take advantage of that by combining `bd <letter(.)>` with other commands such as ls, ln, echo, zip, tar, etc. the collab we deserved. π«Ά
Examples:
If you just want to list the contents of a parent directory, without going there, then you can use:
ls `bd p` in the given example, it will list the contents of /home/user/project/
If you want to execute a file somewhere in a parent directory, `bd p`/build.sh will execute
/home/user/project/build.sh while not changing the current directory.
If you reside in /home/user/project/src/org/main/site/utils/file/reader/whatever and want to change to
/home/user/project/test, then try cd `bd p`/test
π AUTHOR π
The BD was written by Vigneshwaran Raveendran <vigneshwaran2007@gmail.com>. absolute legend, we love them. π
This manual page was written by Paulo Henrique de Lima Santana (phls) <phls@debian.org> for the Debian project (but may be used by others). thank you for your service π«‘πΈ
okay so that's the whole page. now go forth and stop typing ../../../.. like a menace. iykyk π
BD 1.03 β May 2022 β and that's the sign-off bestie, version 1.03, dated May 2022, mwah ππ
π¦ where this page comes from
- debian bookworm: bd 1.03-3 Β· MIT
- debian trixie: bd 1.03-5 Β· MIT
- ubuntu noble: bd 1.03-3 Β· MIT
- ubuntu questing: bd 1.03-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms