Quickly go back to a directory instead of typing cd ../../..

Description: Quickly go back to a specific parent directory in bash instead of typing "cd ../../.." redundantly.

How to use:

If you are in this path /home/user/project/src/org/main/site/utils/file/reader/whatever and you want to go to site directory quickly, then just type: 'bd site'

In fact, You can simply type 'bd <starting few letters>' like 'bd s' or 'bd si'

If there are more than one directories with same name up in the hierarchy, bd will take you to the closest. (Not considering the immediate parent.)

Using bd within backticks (`bd <letter(s)>`) prints out the path without changing the current directory.

You can take advantage of that by combining `bd <letter(s)>` with other commands such as ls, ln, echo, zip, tar etc..

Check out the screenshot.

85 points vigneshwaran 13 years ago 49 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton