Skip to content

Instantly share code, notes, and snippets.

@randika
Created June 3, 2011 13:46
Show Gist options
  • Save randika/1006368 to your computer and use it in GitHub Desktop.
Save randika/1006368 to your computer and use it in GitHub Desktop.
How To Search Shell Command History
# Search all history
randika@randika-XPS-M1330:~$ history
1 sudo apt-get install aptitude
2 sudo aptitude update
3 sudo aptitude install build-essential curl git-core
........
........
29 chmod 400 xxxxx.pem
30 ssh -i xxxxx.pem [email protected]
# Search particular command, enter:
randika@randika-XPS-M1330:~$ history | grep -i 'ssh'
ssh -i xxxxx.pem [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment