Disable per-session history file in OS X El Capitan
Read time: 1 min
With the release of OS X El Capitan Apple has made a subtle change in how the bash history file works.
History is a handy feature to recall commands you gave in the past, especially if used together with
I’ve been noticing this new (weird) way right after the installation of the latest major release. But I’ve never cared that much about until today, when I stumbled across the solution while playing with bash.
As stated in this StackOverflow answer, bash runs a check every time a new session in started. Disabling the per-session history is as easy as:
You may need to restart your sessions to apply the setting.
Now we may go a bit further and be sure history is written to
.bash_profile with nano
and add the line below at the very end of the file
Of course you can change the path to the one you like the most. Just be sure you have
write permission there. That’s all!
Thanks for reading.
Got some words you want to share? Tell me!