On my old notebook (Debian sid) I had this in my ~/.bashrc and it used to work (e.g. history was more or less unlimited and it was being saved on each command):
export PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "lucio" "t470" "/home/lucio/virtualbit/progetti/workspace/vscode/teom/websi"'
export PS1='\[\e[1;31m\]\u\[\e[1;33m\]@\[\e[1;36m\]\h \[\e[1;33m\]\w \[\e[1;35m\]$ \[\e[0m\]'
export HISTFILESIZE=9999999
export HISTSIZE=9999999
export HISTTIMEFORMAT="%d/%m/%y %T "
shopt -s histappend
export PROMPT_COMMAND="history -a;history -a;printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}""
I copied over the same ~/.bashrc on my new notebook (Debian sid like the old one) and verified it's being applied:
$ echo $HISTSIZE
9999999
but my history is being cut at 1000 entries. I also tried with HISTSIZE=-1 in my ~/.bashrc (based on this information) with same results: my history is being cut at 1000 lines, but I don't want unlimited history anyway, I want a very high limit, such as 9999999.
What am I doing wrong? Why it does not work anymore while it used to work on my old notebook? Maybe there was a package other than bash itself on my old notebook that made it work?
EDIT: this question has been marked as duplicate of this other question,but please note it's not a dup. I already know how to have unlimited history in bash, except that solution DOESN'T work in my case and I don't want unlimited history anyway.
.bashrc? Are you sure there are no assignments toHISTSIZElater in the file? – Kamil Maciorowski Jan 08 '21 at 16:30echo $HISTSIZE. Anyway, I confirm those are the last lines of my.bashrc– Lucio Crusca Jan 08 '21 at 16:34HISTSIZEis not really respected. Looks like on reboot the history gets truncated to 1000. – dvo Jun 12 '23 at 12:55