7

I cant find .bash_history file in my home directory. I do:

echo $HISTFILE
/home/myname/.bash_history

But if I try to list the file with ls, I get:

$ ls -l ~/.bash_history
ls: cannot access /home/myname/.bash_history: No such file or directory

If I run the history command, however, all history commands are listed.

So, why I can't see .bash_history file?

closed as off-topic by terdon, A.B., Seth Oct 6 '15 at 20:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – terdon, A.B., Seth
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Is the history shown if you open a new terminal and run history? Please edit your question and post the output of ls -l ~/.bash_history (just to be sure). – terdon Oct 6 '15 at 17:30
  • got: ls: cannot access /home/myname/.bash_history: No such file or directory – vico Oct 6 '15 at 17:32
  • in new terminal history is missing – vico Oct 6 '15 at 17:33
  • 2
    Ah, there you go. You've deleted the file, apparently. Your current terminal still has it in memory but a new one doesn't so history returns nothing. I'm voting to close this since it is unlikely to help anyone else. – terdon Oct 6 '15 at 17:34