LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   why prompt doesn't get updated ? (https://www.linuxquestions.org/questions/linux-newbie-8/why-prompt-doesnt-get-updated-4175442955/)

.product 12-26-2012 01:18 AM

why prompt doesn't get updated ?
 
Linux noob question.
Lets say i have a sub directory called 'a' under 'test'
:~/test/a
now when i rename the directory from above location using mv ../a ../b
i am still left inside the :~/test/a and continue to work as normal while pwd shows the :~/test/b

Is there a way to make changes to command prompt so that it updates the location.

tommcd 12-26-2012 02:27 AM

If you cd up to the parent directory (in this case test) and then cd back into the newly named b subdirectory the pwd command will be updated to show the working directory to be b. I don't think you can get the terminal to update the location until you leave that directory.


And welcome to the LQ forums!

grail 12-26-2012 05:23 AM

Or you could cd into the current directory:
Code:

$ cd .
If you want to really freak yourself out try this:
Code:

$ cd test/a
$ rm -rf ../a

You will find that you are still in the a directory until you move elsewhere :)

.product 12-27-2012 06:24 AM

Thanks folks.
It was indeed freaky :)


All times are GMT -5. The time now is 11:12 PM.