I want to execute some commands every time I exit from bash, but cannot find a way to do it. There is a ~/.bash_logout file for when you are logging out, but normally we use interactive shell instead of login shell, so this is not very useful for this purpose.
Is there a way to do this? Thanks!