I am aware that every terminal has it's separate history,which can be viewed by the history command. Commands issued on suppose terminal tty1 will be shown in the history of tty1 only and not in the history of any other terminal suppose tty2.

Is there a file which stores all the commands fired from various different terminals; irrespective of the terminal type (tty,pts1).


Command History is generally a feature provided by bash, and is stored per-user in the .bash_history file in your home directory.

While the history command may show you different histories in different terminals while those terminals are open, they will all be merged and written to the common ~/.bash_history file once you exit the terminals.

| improve this answer | |
  • so does it mean that after reboot I will be able to see the history of all the commands issued from various different terminals on each and every terminal? – Ankit Aug 10 '12 at 16:20
  • 1
    Yes, certainly after reboot the histories will be the same since they will all come from the same .bash_history file. – ish Aug 10 '12 at 16:37

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.