Retaining Bash history from all sessions

  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

I've noticed that when I have many sessions open, the history from one closed session will overwrite the history from another earlier closed session so that when I open a new session I only see the history of the most recently closed session.

Is there a way I can merge/retain all Bash history from all sessions?

I was thinking about something in the .bash_logout, perhaps a func to merge the histories, appending only the new lines to the history file, but the problem is that the history numbering overlaps, so this could be tricky.

Another question would be how Bash handles the history, is it before or after the processing of the history file? If it's after, then would bash just overwrite the history file with the current session history regardless of what is in .bash_logout?

Any Ideas?
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4922
  • Loc: NY

Post 3+ Months Ago

Look at that first.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 31 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.