I was doing an assignment on Ubuntu that requires screenshots of my commands. But my laptop shut down and the program closed without me taking the screenshots. Is there a way to retrieve my previous commands on Ubuntu?
2 Answers
You can find them in ~/.bash_history
.
Note that ~/
refers to your home folder.
The full path would be, /home/<your-username>/.bash_history
It addition to what others have said here, if you want to see them one at a time, just press the up-arrow key when you are in your terminal. This will display them one at a time. (Hitting enter will re-execute the command, as well.)
less ~/.bash_history
history