0

I know that I can search history with CtrlR. Also I can see timestamps like this:

HISTTIMEFORMAT='%x %r '

then running the "history" command. However I would like to combine the two. I would like to search using one of these or similar:

  • CtrlR
  • history
  • fc
  • grep
  • less

but the result(s) should have the timestamp prepended. Is such a thing possible?

0

This seems to work:

history | grep pattern

I also added this to my "~/.profile":

alias ahist='history | grep -i --color'
HISTIGNORE='ahist *'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.