0

In order to make the behavior system wide, I put unset HISTFILE in /etc/profile. Normal users no longer have .bash_history but root still does. Anyone can tell me what I am doing wrong here? Or what is another proper place I should use instead of /etc/profile ? There is /root/.bashrc which probably do the trick for root, but I just want this setting in one global place so I can toggle it easily, pogo?

1 Answer 1

2

You must take in count the order, how these files apply when user/root logs in. The profile is read first, the ~/.bashrc the last so if you set/unset some variable in the profile, it can be overwritten in the ~/.bashrc of each user. So what you made is like template of the environment, which can be overwritten.

And there are more files you'd better have a look at:

  • content of /etc/profile.d
  • /etc/bash.bashrc

It's better described in this post:

https://serverfault.com/questions/261802/what-are-the-functional-differences-between-profile-bash-profile-and-bashrc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .