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

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:

```powershell
(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](https://images.koorevaar.com/linkedin-import/cloud-shell-bash-history-search.jpg)

---

*Co-authored with Claude.*

If this was useful, [you can buy me a coffee](https://ko-fi.com/p47k0).

New articles: [follow via RSS](https://blog.koorevaar.com/feed.xml).
