Can anyone explain the following? When I use ssh to execute history remotely, no output is produced, even other remote commands do produce output and there is history on that machine.
ssh host 'history | tail' # produces no output
ssh host 'echo foo | tail' # produces 'foo' as output
ssh host
> history | tail # produces expected output
History is not loaded for a non-interactive shell. You can either
tailthe history file (~/.bash_history) or turn on history and load it.The full commands needed to do this from the remote host is as follows: