• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 10, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

bd – Quickly Go Back to a Parent Directory Instead of Typing “cd ../../..” Redundantly

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
32
VIEWS
Share on FacebookShare on Twitter

Contents

  1. How to Install bd in Linux Systems
    1. How to Use bd in Linux Systems

While navigating the file system via the command line on Linux systems, in order to move back into a parent directory (in a long path), we would normally issue the cd command repeatedly (cd ../../..) until we land into the directory of interest.

This can be so tedious and boring much of the time, especially for experienced Linux users or system administrators who carry out so many various tasks, therefore hope to discover shortcuts to ease their jobs while operating a system.

Suggested Read: Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem

In this article, we will review a simple but helpful utility for quickly moving back into a parent directory in Linux with the help of bd tool.

bd is a handy utility for navigating the filesystem, it enables you to quickly go back to a parent directory without typing cd ../../.. repeatedly. You can reliably combine it with other Linux commands to perform a few daily operations.

How to Install bd in Linux Systems

Run the following commands to download and install bd under /usr/bin/ using the wget command, make it executable and create the required alias in your ~/.bashrc file:

$ wget --no-check-certificate -O /usr/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd
$ chmod +rx /usr/bin/bd
$ echo 'alias bd=". bd -si" >> ~/.bashrc
$ source ~/.bashrc

Note: To enable case-sensitive directory name matching, set the -s flag instead of -si in the alias created above.

To enable autocomplete support, run these commands:

$ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd
$ sudo source /etc/bash_completion.d/bd

How to Use bd in Linux Systems

Assuming your currently in the top directory in this path:

/media/aaronkilik/Data/Computer Science/Documents/Books/LEARN/Linux/Books/server $ 

and you want to go to Documents directory quickly, then simply type:

$ bd Documents

Then to go straight into the Data directory, you can type:

$ bd Data
bd – Quickly Go Back to a Parent Directory Instead of Typing “cd ../../..” Redundantly

Switch Between Directories Quickly

Actually, bd makes it even more straight forward, all you need to do is just type bd <few starting letters> such as:

$ bd Doc
$ bd Da
bd &#8211; Quickly Go Back to a Parent Directory Instead of Typing &#8220;cd ../../..&#8221; Redundantly

Quickly Switch Directories

Important: In case there are more than one directories with the same name up in the hierarchy, bd will move you into the closest without considering the immediate parent as explained in the example below.

For instance, in the path above, there are two directories with the same name Books, if you want to move into:

/media/aaronkilik/Data/ComputerScience/Documents/Books/LEARN/Linux/Books

Typing bd books will take you into:

/media/aaronkilik/Data/ComputerScience/Documents/Books
bd &#8211; Quickly Go Back to a Parent Directory Instead of Typing &#8220;cd ../../..&#8221; Redundantly

Move to ‘Books’ Directory Quickly

Additionally, using bd within backticks in the form `bd <letter(s)>` prints out the path minus changing the current directory, so you can use `bd <letter(s)>` with other common Linux commands such as ls, echo etc..

In the example below, am currently in the directory, /var/www/html/internship/assets/filetree and to print the absolute path, long-list the contents and sum up the size of all files in the directory html without moving into it, I can just type:

$ echo `bd ht`
$ ls -l `bd ht`
$ du -cs `bd ht`
bd &#8211; Quickly Go Back to a Parent Directory Instead of Typing &#8220;cd ../../..&#8221; Redundantly

Switch Directory with Listing

Find out more about bd tool on Github: https://github.com/vigneshwaranr/bd

That’s all! In this article, we showed reviewed a handy way of quickly navigating the filesystem in Linux using bd utility.

Have your say via the feedback form below. Plus, do you know of any similar utilities out there, let us know in the comments as well.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

How to Auto Execute Commands/Scripts During Reboot or Startup

Next Post

Use ‘pushd’ and ‘popd’ for Efficient Filesystem Navigation in Linux

Next Post

Use ‘pushd’ and ‘popd’ for Efficient Filesystem Navigation in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet