1

I migrated from mac to linux

I backed up my zsh_history.txt

How can i merge/append it to my .bash_history file?

I see the format is different:

git pull
#1530441990
git push
#1530447814
locate "*ls*" | grep -P 'history'
#1530447865
echo  $HISTFILE
#1530448256



: 1470922871:0;git clone
: 1470923028:0;git clone sso://waze-bimqa-internal/RoutingRegression
: 1470924442:0;ls -ltrh `echo $JAVA_HOME`
: 1470924459:0;java -v
: 1470924464:0;which java
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

0

If you don't care about the timestamps, you could use the history -s command to add lines to the bash history.

bash-4.2$ history -s foo
bash-4.2$ history -s this is a command
bash-4.2$ history 3
   31  foo
   32  this is a command
   33  history 3

You can manipulate your text file to generate the history -s commands and then source it.