Use compcomm to compare the entire history (incl. current Bash session) with the already persisted history in .bash_history and only print those lines that are unique to the current session -- which should show only those commands that were executed since starting the current Bash shell
comm -23 <( history | cut -c 8- ) ~/.bash_history comm -23 <( history | cut -c 8- ) ~/.bash_history Edit: as @Wildcard pointed out this command does not work for all distributions of comm. I tested this on Mac OS.
A variation of the same idea using diff:
diff <( history | cut -c 8- ) ~/.bash_history | sed -n 's/^< //pg'