How to save current path to variable in bash

In this article let’s discuss about How to save current path to variable in bash. Let’s go through the following methods without any delay.

Method 1:

# Saves the current path to the variable "your_variable":
your_variable=$(pwd)

# Go to the path inside the variable:
cd $your_variable

Hope the above solution works.

Realted Posts : How to add-apt-repository