LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2012, 02:18 AM   #1
.product
LQ Newbie
 
Registered: Dec 2012
Location: India
Distribution: Ubuntu
Posts: 8

Rep: Reputation: Disabled
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.

Last edited by .product; 12-26-2012 at 02:21 AM.
 
Old 12-26-2012, 03:27 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
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!
 
Old 12-26-2012, 06:23 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,424

Rep: Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823Reputation: 2823
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
 
Old 12-27-2012, 07:24 AM   #4
.product
LQ Newbie
 
Registered: Dec 2012
Location: India
Distribution: Ubuntu
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks folks.
It was indeed freaky
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
primary screen doesn't work anymore since i've updated Capozzi Linux - Newbie 1 10-26-2012 08:50 PM
A distro that doesn't require 'core' components to be updated chessonly Linux - General 4 06-02-2009 09:25 AM
Linux doesn't see updated /etc/modules.conf svele Debian 5 04-15-2004 08:01 AM
Updated FC1 Kernel doesn't support usb... Ryknow215 Fedora - Installation 5 01-29-2004 11:41 AM
Updated Mozilla, JVM doesn't work anymore GT_Onizuka Linux - Software 9 10-17-2003 01:48 AM


All times are GMT -5. The time now is 02:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration