Removing directories from PATH

I am trying to run rkhunter, but it is giving me this output:

stack/security/rkhunter-1.4.6
➜ sudo rkhunter --check
Password:
Invalid BINDIR configuration option: Invalid 
directory found: ~/.dotnet/tools
Invalid BINDIR configuration option: Invalid 
directory found: 
Workbooks.app/Contents/SharedSupport/path-bin

How do I go into my PATH variable and remove these directories from all shell sessions? None of these directories are in my .bash_profile or .bashrc.


Solution 1:

In terminal, copy the results of path.

echo $PATH

/your/:~/path/:~/.dotnet/tools:/here/:

Paste the contents of PATH into a text editor and remove the troublesome directory in the PATH from between PATH's delimiters, usually :.

Clear the PATH.

export PATH=""

Copy the edited PATH, and store it back in PATH.

export PATH="/your/:~/path/:/here/"