bd(1)

πŸ“¦
version 1.03 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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