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
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
~/.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 opensudo chown -R $USER ~/.bash_sessions; chmod 700 ~/.bash_sessions
Tries to fix permissions (sudo
only works if you have an account with admin privileges)chown
is -R
. Should be: sudo chown -R $USER ~/.bash_sessions; chmod 700 ~/.bash_sessions
.
Commented
Mar 24, 2018 at 3:01
$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
.
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:
sudo mkdir YOUR_PATH/.bash_sessions
Everything seems to be back to normal now!