When we switch the parent directory on a Linux server, the CD is usually used. /.. /, there are several levels of directories to enter a few times ". /"If the directory is too deep to nest, it will be a bit of a dizzy dish ... Therefore, this introduction of the tool, you can quickly return to the specified parent directory.
1. Installation
# Download sudo wget --no-check-certificate-o/usr/bin/bd https://RAW.GITHUB.COM/VIGNESHWARANR/BD/MASTER/BD # Modify Permissions sudochmod +rx/usr/bin/bd# Add alias, ignore case Echo' Alias bd= ". Bd-si "' >> ~/~/.BASHRC
2. Use
# Assuming the current path is as follows /home/hadoop/medis/data/program/books/learn/scala/test# Use the following command to tune to /home/hadoop/ medis/data/program/Books directory BD Books
You can also use ' BD < start several letters > ' to move directly to the directory that starts with that letter. Note: When the hierarchy has the same name directory,BD will move to the nearest directory instead of the parent directory that first appears :
# Assuming the current directory /home/hadoop/medis/data/program/books/learn/scala/test/extra/scala/play/structure# Jump to /home/hadoop/Medis in BD me# with the same name as the Scala directory, current path /home/hadoop/medis/data/program/books/learn/scala/test/ extra/scala/play/structurebd Scala/home/hadoop/medis/data/program/books/learn/scala/test/extra/scala/
Finally, in conjunction with other commands, note that the BD command in the command line quotes is used only to list the switched directories and does not perform a switchover, so the current path does not change
#当前路径/home/hadoop/medis/data/program/books/learn/scala/test/extra/echo ' BD Lea ' /home/hadoop/medis/data/program/books/learn/ls -4 drwxrwxr 34096: Scala
Linux tools: Quickly return to a level parent directory--BD