Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
44
rated 0 times [  44] [ 0]  / answers: 1 / hits: 48080  / 3 Years ago, wed, august 11, 2021, 9:28:40

I am running 12.04 server and when I type history in bash I see most of the commands I have entered into bash but I don't see the commands I have entered when in a tmux session.



How do I see the history of the commands I have run inside a tmux session on Ubuntu 12.04 server after I have ended the session?


More From » bash

 Answers
2

You have to preserve bash history in multiple bash shells. To do this, be sure that you have the following lines in your ~/.bashrc file:



# avoid duplicates..
export HISTCONTROL=ignoredups:erasedups

# append history entries..
shopt -s histappend

# After each command, save and reload history
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"


Source: https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows


[#29680] Thursday, August 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
azaaburge

Total Points: 266
Total Questions: 85
Total Answers: 109

Location: Djibouti
Member since Sat, Oct 29, 2022
2 Years ago
;