mkdir: /Users/NAME/.bash_sessions: Permission denied touch: /Users/NAME/.bash_sessions/NUMBER.historynew: No such file or directory

mkdir: /Users/NAME/.bash_sessions: Permission denied

touch: /Users/NAME/.bash_sessions/NUMBERS.historynew: No such file or directory


they told me to run this command but it doesn't work


MacBook-Pro-2:~ NAME$ rm -r ~/.bash_sessions

rm: /Users/NAME/.bash_sessions: No such file or directory

MacBook-Pro-2:~ NAME$



I HAVE MOJAVE

MacBook Pro, iOS 12.1, mojave

Posted on Nov 30, 2018 1:17 AM

Reply
1 reply

Nov 30, 2018 5:50 AM in response to appleflower007

What are you doing when you see these errors?


Are you issuing the 'mkdir' command or is it coming from a script you are running, or maybe it is happening when you start a Terminal session? What you are doing when you see the error can be useful in diagnosing.


Can you check if the /Users/NAME permissions and ownership match your account (and I know that Name is a substitute for the real account name, so please replace NAME with the current account name?

/bin/ls -dleO@ /Users/NAME

/usr/bin/id

If you decide to post the output from these 2 commands, please edit your account name to NAME. With respect to the 'id' output, everything after your account name is generic and every other Mac user will have the same things in their 'id' output.


And now making a wild guess on my part, could you see if you have one or more of the following files on your Mac

/bin/ls /Users/NAME/.bash_profile

/bin/ls /Users/NAME/.bash_login

/bin/ls /Users/NAME/.bashrc

/bin/ls /Users/NAME/.profile

By default, none of these files exist in a user account, unless the user creates them or runs some install for a Terminal-based utility that creates one or more of them. These are shell initialization scripts for the 'bash' shell, which is the program that reads the commands you type and executes them for you.


However, the kind of errors you are reporting, are sometimes the result of a messed shell initialization script, which is why I'm asking in advance if you have any of these files.


After you explain where are seeing the above errors, if it is while starting up a Terminal session, then knowing in advance you have one of the shell initialization scripts will save at least one extra post/reply cycle. If it is not when you start up a Terminal session, I will only have written a few more words then was necessary 🙂

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

mkdir: /Users/NAME/.bash_sessions: Permission denied touch: /Users/NAME/.bash_sessions/NUMBER.historynew: No such file or directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.