Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
up vote 4 down vote accepted

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.

share|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
Yes, certainly after reboot the histories will be the same since they will all come from the same .bash_history file. – izx Aug 10 '12 at 16:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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