What I have seen is, command line history from one session (pts) is not available to other open sessions (pts).

  1. Is it possible to explicitly commit the history of a session, so that it's available to other sessions immediately.

Further, What i have seen is - history from closed sessions is only available to new sessions. It's not available to existing sessions.

  1. Is it possible to pull the history of closed sessions in to existing sessions.

Above observation is for bash shell.

Could some one explain how history (recording/sharing) works when multiple sessions exists for same user?

1 Answer 1


You can append current shell history to .bash_history file with:

history -a

You can read and load .bash_history file in other session with:

history -r

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.