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 to 0 (zero)

HISTSIZE=0 && exit

5. Quit Bash Shell Without Saving History: Delete HISTFILE and Unset HISTFILE

rm -f $HISTFILE && unset HISTFILE && exit

CC BY-NC-SA 4.0 Quit Bash Shell Without Saving Bash History (5 Methods) by 桔子小窝 is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据