Skip to content

Instantly share code, notes, and snippets.

@nguyenit67
Last active July 19, 2021 09:19
Show Gist options
  • Save nguyenit67/9d6cec5013357881007d91b89b6cdbdd to your computer and use it in GitHub Desktop.
Save nguyenit67/9d6cec5013357881007d91b89b6cdbdd to your computer and use it in GitHub Desktop.
# use $(pwd) instead of $PWD because $PWD is just a variable for display purpose
# not actually change (cd) current working directory
~/dev/MyRepo$ PWD=~/dev/
~/dev$
~/dev$ $PWD
bash: /home/Nashu/dev/: Is a directory
~/dev$ pwd
> /home/Nashu/dev/MyRepo
~/dev$ cd .
~/dev/MyRepo$
~/dev/MyRepo$ $PWD
bash: /home/Nashu/dev/MyRepo: Is a directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment