######bd
Jump to a specific directory up in the hierarchy without doing a cd ..\..\..
repeatedly by directly specifying in full ( or part ) the directory name.
######USAGE
For a current directory path :
C:\User\UserA\Projects\ABC\src\java\com\company\proj\other utilities\basic\d\
To migrate to `src` - `bd src` To migrate to a directory with spaces in its name like `"other utilities"` - `bd "other utilities"`
You can also type in just a few characters of the directory name for unique directory names along the hierarchy
To migrate to `"other utilities"` - `bd ot` To migrate to `Projects` - `bd proje`
Always the lowermost directory is chosen in case the first few chars entered matches with two such directories. This is done with the view that the previous command can be repeated to go to the next higher directory
To migrate to Projects
alternatively you could do bd proj
twice ( instead of bd proje
once ):
> `bd proj` -- Changes the directory to ...company\proj\...
> `bd proj` -- Changes the directory to ...UserA\Projects\...
######Installation
- Run
javac
to compile the helperbd.java
tobd.class
javac bd.java
- Put the java class file in the same directory as bd.bat
bd-\
|- bd.class
|- bd.bat
- Make sure to include the directory in which the
bd.bat
andbd.class
file resides, to thePATH
environment variable permenently.
setx PATH "%PATH%;C:\Path\To\bd\" /M
######Inspiration
This batch/java version is inspired by @vigneshwaranr's bd for bash