I added some simple history command in order to get some info every time I am on a Ubuntu 18.04.2 LTS Dell local machine with bash 4.4.20(1)-release, shell /bin/bash. If I open a new shell:

history | tail

but I noticed that when I open a new terminal it does show me anything, while if I:

source ~/.bashrc

it works well. I guess it has something to do with history characteristics and new terminals but even googling and looking here I can not figure out what!

Thanks in advance for any help!

--- EDITED ---

grep HIST ~/.bashrc ~/.profile ~/.bash_profile
/home/enrico/.bashrc:# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
/home/enrico/.bashrc:export HISTTIMEFORMAT="%Y-%m-%d %T "
grep: /home/enrico/.bash_profile: No such file or directory
  • Possible duplicate of: Preserve bash history in multiple terminal windows
    – jesse_b
    Dec 18, 2020 at 12:51
  • Please edit your question and tell us what operating system you are using. Also show us the output of grep HIST ~/.bashrc ~/.profile ~/.bash_profile and the output of echo $SHELL.
    – terdon
    Dec 18, 2020 at 13:10
  • Also clarify how you are logging in to the machine. Is this a local machine? A remote one you access via ssh? Something else? Are you using a GUI?
    – terdon
    Dec 18, 2020 at 13:29
  • Is the command in your .bashrc or /etc/profile.d ?
    – bxm
    Dec 18, 2020 at 15:01
  • @bxm is in .bashrc, also edited the question accordingly to previous comments
    – cccnrc
    Dec 18, 2020 at 16:46


You must log in to answer this question.

Browse other questions tagged .