On Sat, Jul 27, 2024 at 23:44:08 +0100, mick.crane wrote: > On 2024-07-27 23:08, Greg Wooledge wrote: > > On Sat, Jul 27, 2024 at 22:50:17 +0100, mick.crane wrote: > > > In debian bookworm, xfce desktop, different virtual terminals have a > > > different history if same user presses "up key" in different virtual > > > terminals ? > > > > As your subject says, this is "bash history". And yes, each instance of > > bash has its own separate history. It has nothing to do with your > > terminal emulator or your desktop environment. > Where is it if not in ~/.bash_history?
Then it's wherever you changed it to. > > Bash reads its history from a file (~/.bash_history by default) at > > startup time, manages it in memory while running, and writes it back > > out to the history file upon exiting. > > Does this separate history get written to ~/.bash_history when terminal > emulation thing is closed? You need to specify *exactly* what you're doing. If you close a terminal emulator in such a way that it kills the shell without letting the shell write history to disk, then the history will not be saved. If you want history to be saved, you should exit from the *shell* (e.g. by pressing Ctrl-D), rather than closing the terminal and counting on that to terminate the shell in a way that will preserve history. If you *don't* want history to be saved, there are many ways to make that (not) happen, depending on your terminal emulator and so on. You'll need to experiment, though, to see exactly what happens when you do whatever it is you do. Whenever I need to reboot my computer (kernel update or the like), I decide which shells I want to retain history from, and I exit from those cleanly (^D). I leave the others running, and exit from FVWM, which kills them in a way that causes their history not to be written. If you want a particular shell window's history to be AGGRESSIVELY written to disk every time you run a command, you can arrange for that as well. See <https://mywiki.wooledge.org/BashFAQ/088> for example.