Skip to main content

Linux command: history

For illustration: History

history - recall lines of previous typed input

$ history

List the last 5 commands

$ history -5

Clear history

$ history -c

The last command

$ !!
$ !-1

The command line N

$ !N

Tips and Tricks

Put a space before command to prevent it from being saved in history

Related commands

Powershell: Get-History

Popular posts from this blog

Red Hat: Notes

PluralSight: Free Courses

Register free account at https://app.pluralsight.com to explore these free courses.

Powershell: Check Bad Logon

get-aduser -Filter {BadLogonCount -ne 0} -properties * | select SamAccountName,BadLogonCount,BadPasswordTime,BadPwdCount,@{name='badPasswordTimeDT'; expression={[datetime]::fromFileTime($_.badPasswordTime)}} | sort BadPasswordTime | FT