2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: history
|
|
|
|
layout: command
|
2022-03-04 13:10:09 +01:00
|
|
|
version: 0.59.1
|
2022-02-14 03:22:51 +01:00
|
|
|
---
|
2019-11-28 19:33:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
Get the command history
|
2019-11-28 19:33:17 +01:00
|
|
|
|
2022-02-14 03:22:51 +01:00
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> history --clear```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `--clear`: Clears out the history entries
|
2019-11-28 19:33:17 +01:00
|
|
|
|
2022-02-21 18:26:00 +01:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Get current history length
|
|
|
|
```shell
|
|
|
|
> history | length
|
|
|
|
```
|
|
|
|
|
|
|
|
Show last 5 commands you have ran
|
|
|
|
```shell
|
|
|
|
> history | last 5
|
|
|
|
```
|
|
|
|
|
|
|
|
Search all the commands from history that contains 'cargo'
|
|
|
|
```shell
|
|
|
|
> history | wrap cmd | where cmd =~ cargo
|
|
|
|
```
|