Terminal doesn't open at home

After some recent update or other, terminal always open at /var/www/html rather than at /home/eric.

Any ideas why this is happening or how to get it to open at my home directory?

I’m using Fedora 42 Workstation on a Dell XPS 9315.

What does the output of less /etc/passwd | grep [your_username] spit out?

Replace [your_username] with your actual username. It should have your home directory set as /home/[your_username].

eric@fedora:/var/www/html$ less /etc/passwd | grep eric
eric:x:1000:1000:Eric:/home/eric:/bin/bash
eric@fedora:/var/www/html$

That looks fine. I’m assuming since you’re using Workstation, you have GNOME. Does GNOME Terminal have any option in it’s settings for “Preserve working directory”?

Edit: Just installed it and it does. Go to Preferences > Profiles > (Select your profile) > Command > Preserve working directory. Try setting the option to never. cd back into ~ close and re-open your terminal, see if that works.

2 Likes

That seems to do it. Thanks.
Interesting that that “works,” since “previous session” would have been at ~ after I cd’d out of /var/www/html.

2 Likes

Generally just type cd and hit Enter would bring you back to your home.
Just if you are new to Linux and are not knowing this trick already :slight_smile: