Remove last entry from $PATH

I can find quite a bit of information on how to add a location to my $PATH, but I can’t seem to find anything on how to remove one.

Last week I added ~/.local/bin to my $PATH. I now would like to change that to ~/.local/scripts. I thought I would just delete the ~/.local/bin and then add the ~/.loacal/scripts but I can’t figure out how to delete the bin directory from the $PATH environment.

Any help would be greatly appreciated.

How did you do it? What changes did you make and where?

Welcome @T0meReader to the EndeavourOS forum, I hope you enjoy your time here.

Check this out, it should help you.

Specifically Step 3.


1 Like

I added this to my .bashrc:
export PATH=$PATH:$HOME/.locl/bin

just delete this line and reboot

1 Like

OK. Now I get the following after running $PATH

bash: /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl: No such file or directory

Why would you want to run $PATH? It’s trying to run a file that way. But there’s obviously no file at that path. To look at the current value of $PATH, run echo $PATH.

1 Like

You’re right. My bad. I think I have it sorted now.
my first mistake was not rebooting and my second was forgetting “echo”.

Thanks for the prompt replies.

You don’t need to reboot.

You can just do source .bashrc for changes to take effect.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.