Blog
Home

Azure Cloud Shell tip: find previously used commands faster in your Bash and PowerShell history

11 August 2026 · 53 views

Usually I need to use the same commands again after a few weeks, and forget the exact syntax. That is why I sometimes open .bash_history to search for commands that I used earlier.

In Bash, I open .bash_history in the Azure Cloud Shell editor and use Ctrl + F to search for a keyword, just like in a normal text file.

In PowerShell, search for the history file with:

(Get-PSReadLineOption).HistorySavePath

After opening the file in the editor you can search it in the same way.

It is a simple habit, but it saves time when:

  • You need to repeat a command you used before.
  • You remember the result, but not the exact syntax.
  • You want to reuse a troubleshooting step quickly.
  • You want to browse or compare several previous commands.

Bash and PowerShell both support Ctrl + R for quick reverse history search. If I want to browse the complete history, I can open the history file and use Ctrl + F to search it like a normal text file.

For me, it is often easier than trying to rebuild the command from memory.

A small but useful tip if you work with Linux or Azure Cloud Shell from time to time.

Bash history search screenshot

Co-authored with Claude.

If this was useful, you can buy me a coffee.

New articles: follow via RSS.

Comments

← All articlesView as Markdown