4

I'm not referring to the . you see in shell commands or in the output of ls -a.

I just ran an install script for a vpn application, and after the command exited, my terminal prompt was in the . directory.

This is my pwd output:

➜ pwd
.

I've never seen anything like this. Anyone know what this is?

11
  • 1
    You have this ticket tagged with bash, shell, and zsh...can you clarify which shell you are using?
    – jesse_b
    Aug 26, 2020 at 15:33
  • I'm on elementary OS and I'm not sure which shell the script used. My default shell is zsh but I still have bash installed
    – dukeluke
    Aug 26, 2020 at 16:07
  • @dukeluke the first line of the script (shebang) will tell you
    – Panki
    Aug 26, 2020 at 16:58
  • You can configure the prompt however you want. Something in your config tells the shell that the prompt should now contain a .. Run echo $PS1 and mention the shell (bash, zsh, ...) you are using. That way we can find the reason
    – Garo
    Aug 26, 2020 at 17:07
  • Also, take a look at the script, most likely it will change $PS1 (the config of the first line of your prompt) there
    – Garo
    Aug 26, 2020 at 17:12

1 Answer 1

4

That can happen when the current working directory has been deleted:

$ zsh -c 'mkdir dir; cd dir; rmdir $PWD; cd .; pwd; readlink /proc/self/cwd; command pwd'
.
/home/chazelas/dir (deleted)
pwd: couldn't find directory entry in ‘..’ with matching i-node

(the cd . causes zsh to double-check what its current directory is, and it reverts to . (the only possible valid path to the current working directory) when getcwd() returns with an error)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.