Home > database >  Viewing command history in Google Cloud shell
Viewing command history in Google Cloud shell

Time:05-10

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!

CodePudding user response:

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.

  • Related