2

I am on Mojave 10.14.4 and my terminal literally has 100 or so commands in its history when it should have ten times that. It seems as though it never saves the commands, whether I open the terminal through Go2Shell or directly.

Does anyone know how I can fix this? I exit the terminal through exit and I copied a set of commands so that if I execute exit and there is only one terminal window open the app will quit itself (I think from this forum).

I don't know when this started. The computer is new, bought in February, so something I did at the beginning must have changed that behavior. The commands I see I remember using them to set some things up. I added the commands so that it would quit itself very early on too.


PD1: I only noticed this recently when I needed a command I had used the day before.

PD2: For the record, the commands that have been used in the current session are accessible through the up arrow, is only when I exit and open a new instance that they are not being saved.

  • help history; history -a; i suggest you add a time stamp by putting HISTTIMEFORMAT='%F %T ' in your bash profile; echo the HISTFILESIZE=50000 HISTSIZE=5000 variables to see what is in effect. – historystamp May 21 at 3:57
  • @historystamp: Maybe consider writing that up as an answer? – Seamus May 21 at 9:39
  • I tried that not long after I wrote this. All the commands in the history appeared as though they were executed that same day. And after I exited the new ones werent saved. I only added the time stamp as a command in the terminal, not in bash profile, would adding it there somehow make the history get saved? – M.O. May 21 at 12:44
  • I did it and yea it works! I don't know why but now all my commands are being saved. Thank you! – M.O. May 21 at 12:50

You must log in to answer this question.

Browse other questions tagged .