1

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?

2 Answers 2

1

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
0

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 .