Find a range of commands in my history
So we all do the right thing with regard to managing how we do things. Keep a daily journal or otherwise Evernote our trials and tribulations - that way we can search for just about anything.
However we also know how this can fall apart and we still end up searching our terminal history for something particulary inane that at the time seemed we would never have to do that again for awhile.
I know I did a
docker-compose create
not too long ago. No Problem:
history|grep docker|grep compose|grep create
12390* docker-compose create
Hmmm, but I think I really need are the commands before and after this one. Let’s grab a half dozen or so commands surrounding this one:
fc -l 12388 12394
12388* docker rmi $(docker images -q -f dangling=true)
12389* docker-compose build
12390* docker-compose create
12391* docker-compose start
12392* docker-compose exec web bundle exec rake db:create
12393* cp /Volumes/DAN/dantmcgowan/Downloads/2017-04-18.dump .
12394* docker-compose exec postgres pg_restore /hammerhead/2017-04-18.dump
Perfect. Now I have what I need!
Comment