How can I point the 'history' command to an alternate file?
Solution 1:
HISTFILE
is the file where the command history is saved (and read on startup, and also it's the default for history
command when no filename argument is given, but mostly it's for saving).
Clear current history list and then read another history file to the current history list:
history -c
history -r /path/to/other-histfile
You might want to modify HISTFILE
too, so it does not get saved.