Automatically write new bash history to change-log file Every time I ssh into a server I might issue some bash commands and then sign off (hup signal?). Is there a way to write the shell commands that I issued on the server to some changelog file?

I want to remove basic commands like ls/cd, and duplicate commands, as well.  It's basically as if every command I issue in bash is like this:

eval "$(my_command | tee "$HOME/change.log")"


but I don't know how to set this up, anybody know a good way to do this?

It would be really nice to eliminate commands like ls and cd, but also show the pwd of every command that was issued:

command  (/home/ubuntu)
command1 (/root/.ssh)
command2 (/home/ubuntu/teros)
command1 (/usr/local)
command1 (/usr/local/lib)
command3 (/etc)
Try using GNU Screen or Tmux. These are called "screen multiplexers" but you'd get a number of benefits


The commands you run will continue running even if you disconnect, or you have network related connection drops. Both software allow "re-attaching" to the running session
Command outputs will persist in memory. You can start a long running command, log off, then connect back some time later and see the output of the command.
Save the whole shell session to a file. You can have the log of all the commands you issued, as well as the output you got, in plain text format.