When I open terminal now I get always this error message. Any ideas how to fix this?

mkdir: /Users/me/.bash_sessions: Permission denied
touch: /Users/me/.bash_sessions/9F11525D-3E4C-45B5-8FA7-D69A4D2CC5B3.historynew: No such file or directory

2 Answers 2


~/.bash_sessions is a folder used to store the history of past bash sessions. Apparently the permissions are wrong (however this happened), there are several ways to tackle this:

  • rm -r ~/.bash_sessions Deletes the whole folder, should get recreated with the next Terminal tab/window you open
  • sudo chown -R $USER ~/.bash_sessions; chmod 700 ~/.bash_sessions Tries to fix permissions (sudo only works if you have an account with admin privileges)
  • 1
    The recursive option for chown is -R. Should be: sudo chown -R $USER ~/.bash_sessions; chmod 700 ~/.bash_sessions. Mar 24, 2018 at 3:01
  • Where it says $User should I put my $pepito ? like this? Nov 30, 2018 at 9:11
  • it tellms me rm -r ~/.bash_sessions - No such file or directory Nov 30, 2018 at 9:12
  • @VishuVanklein $USER should actually be already set correctly. If you get a No such file or directory error the file/folder is not actually there. If this is still the same issue as the one you asked the question about 14 months back (:-)) please amend the question with the output of ls -ld ~ ~/.bash_sessions.
    – nohillside
    Nov 30, 2018 at 9:27

I just encountered this error and I was able to get past it without restarting my machine as suggested by another user. I did the following:

  1. sudo mkdir YOUR_PATH/.bash_sessions
  2. I quit and restarted my Terminal

Everything seems to be back to normal now!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .