merge-bash-history: command line utility to merge bash_history

[ bsd3, library, program, tools ] [ Propose Tags ]

Please see

[Skip to Readme]


Maintainer's Corner

For package maintainers and hackage trustees


Versions [RSS],
Dependencies attoparsec (>=0.12), base (>=4.7 && <5), data-ordlist (>=0.4), errors (>=2), merge-bash-history, optparse-applicative (>=0.11), text (>=1.2) [details]
License BSD-3-Clause
Copyright 2015 Jiri Marsicek
Author Jiri Marsicek
Category Tools
Home page
Source repo head: git clone
Uploaded by JiriMarsicek at 2018-09-17T11:32:09Z
Distributions NixOS:
Executables merge-bash-history
Downloads 1239 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-09-17 [all 1 reports]

Readme for merge-bash-history-

[back to package description]


Utility to be used with unison ( to merge .bash_history file accross multiple machines.


Clone the repository

git clone

Install using stack

cd merge-bash-history
stack install

Example configuration in unison preferences file

Assuming you have root set to your home directory and merge-bash-history is in your $PATH

Add following to your unsion .prf file

merge = Name .bash_history -> merge-bash-history CURRENT1 CURRENT2 > NEW
backupcurrent = Name .bash_history

Manual usage

merge-bash-history [INPUT-FILE1] [INPUT-FILE2] > [MERGED-FILE]


  • Does not support line deletion (e.g. manual removal of lines from .bash_history file)


  • Sorts .bash_history file by timestamp if not sorted
  • removes duplicates (comparing timestamp and command)

Recommended Bash settings

shopt -s histappend

From Pawel Hajdan (