Viewing command history in Google Cloud shell

2.4k views Asked by At

I am trying to view some commands I used several months ago for a course project. I used the history command but it only showed very recent lines. Is there a way to view older command history? thanks!

1

There are 1 answers

2
rickyticotaco On

Your list of executed commands is stored in .bash_history. You can find this file in the home folder of Cloud Shell.

Cloud Shell's home folder is deleted after 120 days of inactivity. So, if you're looking for commands that you used several months ago and your Cloud Shell was inactive for more than 120 days, chances are that your disk was deleted.

Also, by default, bash stores the last 500 executed commands history.