Created
March 10, 2019 22:34
-
-
Save shubhamagarwal92/4c2f10da3fcd69d0b0fb299a1e82d2b1 to your computer and use it in GitHub Desktop.
Go the parent directory of the current bash file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CURRENT_DIR=${PWD} | |
export PARENT_DIR="$(dirname "$CURRENT_DIR")" | |
echo "You are in: " | |
echo $CURRENT_DIR | |
echo "Parent directory is: " | |
echo $PARENT_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment