On Sun, Jul 28, 2024 at 02:01:04 +0100, mick.crane wrote: > On 2024-07-27 23:58, Greg Wooledge wrote: > > You need to specify *exactly* what you're doing.
> Sometimes I forget where I was after closing a virtual terminal and it > would be handy to see the history > in a new terminal, where I "cd'd" to for example. > stuff like that. No, I mean *how did you close the terminal*? And what terminal is it? In the ideal scenario, if you closed the terminal by pressing Ctrl-D in the shell, the history should be written to disk. Then, opening a new terminal+shell should read that history into memory. You should be able to search the previous shell's history in that new shell. There are lots of ways this could fail. For example, you might be closing the terminal window by using a window manager control button, or by running the xkill(1) program and then clicking the window. Or, you might have too many history lines in memory at the time you exit the shell, and the cd command that you wanted to find might be dropped because it was too far in the past. (Bash only stores 500 lines of history by default.)