noscript-img
HomeAboutLinux NewsLinksPrivacy
My Computer Tips Home

How can I view all of the bash history in Linux using the terminal

ID: 60

Category: Linux Terminal

Added: 23rd of December 2015

Updated On: Tutorial updated and rechecked on 10th of July 2025

Views: 3,619

Every time you enter a command in the terminal, it is written to the .bash_history file.

The .bash_history log file is located in your home directory. This is a hidden file, so you need press CTRL + H on your keyboard to view the file.


.bash_history file, located under your home directory

To view all the commands you entered in the terminal, enter the following command

cat .bash_history

If you want a hard copy, you can also output this to a .txt file by enter the following command in the terminal
cat .bash_history > /home/$USER/Desktop/bash_history.txt