Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Here's a typescript of something I find... flummoxing.
Code:
$ # Whoa, this is weird. I'm in home sweet home...
$ pwd
/home/me
$ # I make a directory "baz":
$ mkdir baz
$ cd baz
$ # Okay, here we are.
$ pwd
/home/me/baz
$ # I rename "baz" to "qux" while still in "baz"...
$ mv ../baz ../qux
$ pwd
/home/me/baz
$ # Huh? I thought I was in "qux" now!
$ cd ..
$ cd baz
bash: cd: baz: No such file or directory
$ # Now it's gone?
$ cd qux
$ pwd
/home/me/qux
$ # But "qux" exists. That is weird.
Why does "baz" not show up as "qux" until I reenter the directory?
I don't think that's weird.
Though I have no technical data to back me up.
But, probably, since you are in that directory and it's active, it can't just change willy nilly right out from under you. It apparently maintains its identity until the 'session' is released.
Yeah, I guess "weird" is the wrong word... more like "interesting."
The issue, as I see it, is "when is the name of the current working directory set?" I presume the answer to that is pretty low-level, kernel-level stuff.
Come to think about it, I should reproduce the sequence of commands in different shells, and maybe from a Perl script, to see if I could come up with a different result.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.