Simple Trick: History Command

So today I quickly installed Redis on a server, and I wanted to keep a copy of all the commands I had used to do so. I knew there was a better way than hitting the up arrow each time to copy and paste each command in reverse order. So after some Googling, I found out about the history command. So I was able to type the command “history” and it showed me the last two thousand or so commands I had used. I was able to copy and paste that into a wiki, and was good to go. You could also search your history by piping the history command to grep. Cool stuff I don’t want to forget.

1 thought on “Simple Trick: History Command

  1. Try ctrl + r to search history. (press ctrl + r again to step through matches).

    Like

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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close