This question already has an answer here:
Imaging the next simple file structure within the /home/user/ directory:
/home/user |--dir0 |--dir1 |--file1
My current directory is 'dir1' and I remove the directory from inside with the following command:
rm -r ../dir1
After that (and not getting any errors on the terminal), the working directory still is the same and when using the command pwd the output is:
user@ubuntu:~/dir0/dir1$ pwd /home/user/dir0/dir1 user@ubuntu:~/dir0/dir1$
Why would the OS return that the working directory is 'dir1' if that was already removed from the filesystem?