Linux tools: Quickly return to a level parent directory--BD

Source: Internet
Author: User
Tags parent directory

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.