If I run `history`, I can see my latest executed commands.

But if I do `tail -f $HISTFILE` or `tail -f ~/.bash_history`, they do not get listed.

Does the file get locked, is there a temporary location or something similar?
['https://unix.stackexchange.com/questions/145250', 'https://unix.stackexchange.com', 'https://unix.stackexchange.com/users/57143/']
(Not an answer but I cannot add comments)

If you are checking `.bash_history` because you just want delete a specific command (e.g. containing a password in clear), you can directly delete the entry in memory by `history -d <entry_id>`.

For example, supposing an output like:

```
$ history
926  ll
927  cd ..
928  export --password=super_secret
929  ll

```

and you want purge the `export` line, you can simply achieve it by:

```
history -d 928

```
The easiest way to find where your bash history is stored is with this:

`echo $HISTFILE`