bash history

1. Useful References

http://blog.macromates.com/2008/working-with-history-in-bash/

2. Cut the number from history command

http://stackoverflow.com/questions/7110119/bash-history-without-line-numbers

$ history | cut -c 8-

3. Grep it

history | grep "mysql"

4. run by number

!10

5. run based on the search

!his

6. run the previous command : !!

7. previous last argument : !$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s