I am trying to find commands executed on my xen server yesterday - but the oldest command to be seen with history dates from today. Is there a way to see older commands (history displays 380 latest commands on my server)?

  • 1
    Which distribution are you using? What number do you get when you execute echo $HISTSIZE in a terminal window?
    – Tsundoku
    Dec 11 '18 at 15:25
  • I get 1000. I am on CentOS 7
    – Matina G
    Dec 11 '18 at 15:31
  • 5
    @GAD3R That would be the future-oriented solution. But this question looks like it wants to find commands that are no longer in the HISTORY (which is probably not possible).
    – Tsundoku
    Dec 11 '18 at 15:32
  • 1
    Restore your history file from last night's backup?
    – doneal24
    Dec 11 '18 at 16:45

I'm afraid your yesterday's history is gone (if not within the 380 lines). Just guessing: Your HISTFILESIZE shell variable is set to around that value. That's "the maximum number of lines contained in the history file." (man bash) which persist across logout / logins. Try setting higher.

  • 1
    That's going forward; doesn't answer the actual question.
    – tink
    Dec 11 '18 at 16:34

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.