.TH bd "1" "May 2022" "BD 1.03" "quickly go back to a specific parent directory in bash" .\" Text automatically generated by txt2man .SH NAME \fBbd \fP- quickly go back to a specific parent directory in bash \fB .SH SYNOPSIS .nf .fam C . \fIbd\fP [\fIoptions\fP] \fIdirectory\fP .fam T .fi .fam T .fi .SH DESCRIPTION \fIbd\fP allows you to go to \fB.\fP parent \fIdirectory\fP in bash instead of typing "cd ../../.." redundantly. .PP You can simply type \fIbd\fP with starting few letters and it will auto complete the \fIdirectory\fP name. .PP It can be used with other commands such as ls, ln, echo, zip, tar, etc. .SH OPTIONS .TP .B \fB-si\fP It is not necessary type the full \fIdirectory\fP name (meaning starts with) and just give the starting few characters. .TP .B -\fB.\fP Enable case-sensitive \fIdirectory\fP name matching. .SH NOTES To avoid to have to use "." and "\fB-si\fP/-\fB.\fP" every time, you can add the line below in your .bashrc file: .PP .nf .fam C echo 'alias bd=". bd -si"' >> ~/.bashrc .fam T .fi And then, do: .PP .nf .fam C source ~/.bashrc .fam T .fi .SH OTHER USES Using \fIbd\fP within backticks (`\fIbd\fP `) prints out the path without changing the current \fIdirectory\fP. .PP You can take advantage of that by combining `\fIbd\fP ` with other commands such as ls, ln, echo, zip, tar etc. .PP Examples: .PP .nf .fam C 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 .fam T .fi .SH AUTHOR The BD was written by Vigneshwaran Raveendran . .PP This manual page was written by Paulo Henrique de Lima Santana (phls) for the Debian project (but may be used by others).