Maybe just for the sake of clarity
/.bashrc
would be a file in your root directory /
. This file could never be read by any user.
On the other hand ~/.bashrc
means the .bashrc
file from the current user.
Another option is to edit the .bashrc
file in your /etc/skel
directory, this change is global and every user in the system would have it as default when created.
.bash_profile
as the official docs say:
This is the preferred configuration file for configuring user
environments individually. In this file, users can add extra
configuration options or change default settings:
This file adds some per user extra variables.
PS. If we talk about security, it is not recommendable to have exec paths in your home directory, the most secure option would be to have your eclipse in some place like /opt
and as root create a symlink to the binary like:
cd /usr/bin
ln -s /opt/path/to/eclipse
This will produce a link for all the users and you won't need to add this specific ( and probably dangerous ENV var for every user)
echo $PATH
output from a new bash session. – L29Ah Aug 13 '17 at 10:29/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/games:/home/ivan/Documents/node-v6.11.0-linux-x64/bin/
– NiHao92 Aug 13 '17 at 11:36PATH
definitions?grep PATH /etc/bash.bashrc ~/.bashrc
Did you really mean/.bashrc
or is that a typo? Add the lineecho foo
below yourexport PATH
line and see whether it is executed. – Hauke Laging Aug 13 '17 at 12:23export PATH=$PATH:/home/ivan/java-oxygen/eclipse
to ~/.profile – NiHao92 Aug 13 '17 at 13:02.bashrc
vs.bash_profile
but as Gilles pointed out in a previous post, and I agree: Environment variables should be set in one of the profile files as they should only need to be set once at login. That being said I think it should still be working if placed in.bashrc
so this isn't being offered as a solution to the problem. – jesse_b Aug 13 '17 at 13:03.profile
file source your.bashrc
and it shouldn't be an issue. – jesse_b Aug 13 '17 at 13:04.bash_profile
is sourced when you start alogin
bash shell..profile
is used by all (maybe not all?) other shells for the same purpose, additionally some systems don't have a.bash_profile
or you can remove your.bash_profile
altogether and this will cause bash to use.profile
..bashrc
is sourced whenever you start an interactive shell. http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html – jesse_b Aug 13 '17 at 13:07/bin/sh
I'm not sure where that points on linux mint (readlink -f /bin/sh
). If it's pointing to/bin/dash
it may not source your.bash_profile
. Also did you log out and back in or just open a new terminal? – jesse_b Aug 13 '17 at 13:22.profile
or.bash_profile
each time you open it. In this case I think.bash_profile
is not being called because your default shell isdash
and notbash
. – jesse_b Aug 13 '17 at 13:29