When I open Terminal, I get the following error

mkdir: /Users/me/.bash_sessions: Operation not permitted

Any idea why that may be the case? Is there a solution?


More than likely the error message is produced by the file- /etc/bashrc_Apple_Terminal in the last line of this snippet:

# Set up the session directory/file.
mkdir -m 700 -p "$SHELL_SESSION_DIR"

Operation not permitted would suggest some kind of a file lock. Edit your post with the following command and its output:

 ls -lOed $HOME

It's likely that there's something in your profile which is incorrect. Check the contents of your shell's profile, such as ~/.bash_profile. Remove any lines you don't expect or which make reference to mkdir or .bash_sessions.

You must log in to answer this question.

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