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
  • 66,199
  • 35
  • 114
  • 250
  • Why would you do that? Why not keep using zsh? If you're used to zsh, [going back to bash is a recipe for disappointment](https://unix.stackexchange.com/questions/983/what-features-are-in-zsh-and-missing-from-bash-or-vice-versa). – Gilles 'SO- stop being evil' Jul 01 '18 at 21:09

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.

Stephen Harris
  • 42,369
  • 5
  • 94
  • 123