Introduction to PowerShell for Unix People by Powershell.org - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

11. commands detail - h

head

The PowerShell equivalent of the *nix head is:

img137.png

history

The Powershell equivalent of history is:

img138.png

There is a built in alias history

It’s worth noting that history doesn’t persist across PowerShell sessions, although if you search online there are a couple of published techniques for making it persistent.

It’s also perhaps worth noting that Powershell gives you a couple of extra bits of information, if you want them:

img139.png

history | egrep -i ls

There is no direct equivalent of the shell functionality you get with set -o vi sadly. You can up- and down- arrow by default, but if you want to search through your history then you need to do something like thishistory | select commandline | where-object {$_.commandline -like '*ls*'} | fl

You may also like...