LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01: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 01:21 AM.
 
Old 12-26-2012, 02:27 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
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, 05:23 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
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, 06: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



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 07:50 PM
A distro that doesn't require 'core' components to be updated chessonly Linux - General 4 06-02-2009 08:25 AM
Linux doesn't see updated /etc/modules.conf svele Debian 5 04-15-2004 07:01 AM
Updated FC1 Kernel doesn't support usb... Ryknow215 Fedora - Installation 5 01-29-2004 10:41 AM
Updated Mozilla, JVM doesn't work anymore GT_Onizuka Linux - Software 9 10-17-2003 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 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
Open Source Consulting | Domain Registration