bash history list view like powershell?

1k Views Asked by At

With PSReadLine 2.2.0 beta4

Set-PSReadLineOption -PredictionSource History

Set-PSReadLineOption -PredictionViewStyle ListView

powershell can show history like this:

enter image description here

Does Bash or any other Linux shell have this feature?

1

There are 1 best solutions below

1
Tim On

You can use the history command to see your previous commands. If you want to filter then you can use the grep command, for example

history | grep git

you will get for example :

  207  git push origin init-repo
  226  git status
  227  git add war/src/main/java/com/xxx/Application.java
  228  git status
  229  git fetch
  230  git checkout init-repo
  231  git stash
  232  git stash pop
  233  git add pom.xml
  234  git status
  235  git add *
  236  git add all
  237  git add-all
  238  git --help
  239  git add --all
  240  git stash
  241  git stash pop
  242  git add --all
  243  git pull
  502  history | grep git
[admin@host]$