[CentOS] My current directory is lost in a bash shell

Sat Mar 3 12:14:11 UTC 2007
Robert Becker Cope <robert at gonkgonk.com>

Theo Band <theo.band at xanadu-wireless.com> wrote:

> [thba at vink layout]$ nc script/xw_functions.ample
> NEdit: getcwd() fails: No such file or directory
> NEdit: getcwd() fails: No such file or directory
> [thba at vink layout]$ ll script/xw_functions.ample
> -rw-rw-r-- 1 thba thba 16829 Oct 25 16:59 script/xw_functions.ample
> [thba at vink layout]$ pwd
> /home/thba/workarea/colibri/design/ana/layout
> [thba at vink layout]$ /bin/pwd
> /bin/pwd: cannot get current directory: No such file or directory

This is typical when the directory you are in has been removed out from under
you. Try this:

Log into two shells (or use screen, or whatever), A and B. In A, do "cd ~;
mkdir -p xxx/yyy; cd xxx/yyy; touch 123; ls -l 123". Then, in B, do "cd ~; rm
-rf xxx". Finally, back in A, repeat what you did above, "ls -l 123; pwd;
/bin/pwd". You will find the behavior is the same.

Good luck,

robert