Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

to remember all commands typed in multiple terminal

# Avoid duplicates
HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend

# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'
'}history -a; history -c; history -r"
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #remember #commands #typed #multiple #terminal
ADD COMMENT
Topic
Name
6+3 =