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.
SHELL_SESSION_DIR="$HOME/.bash_sessions"
SHELL_SESSION_FILE="$SHELL_SESSION_DIR/$TERM_SESSION_ID.session"
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.