Quit Bash Shell Without Saving Bash History (5 Methods)

Remove Only Current Session Bash History and Leave Older History Untouched

1. Quit Bash Shell Without Saving History: Unset HISTFILE

unset HISTFILE && exit

2. Quit Bash Shell Without Saving History: Kill Console

kill -9 $$

Remove/Delete Bash History Completely

3. Quit Bash Shell Without Saving History: Clear History Option

history -c && exit

4. Quit Bash Shell Without Saving History: Set HISTSIZE (更多…)