This is a test version of Biostars. For the public version, visit https://www.biostars.org.
I can/t use mkdir -p ~/bin

By reading biostars handbook, I found I can't use the command mkdir -p ~/bin, or other command related to ~/bin. The answer showed: "/Users/apple/bin: Not a directory". please help

software error

what is the 'response' for the mkdir command ?

likely you don't have permissions (though a bit weird you won't) to create that folder .

Thxs for your kindly reply. when I go to the bin directory and mkdir a new directory. It said like this "appledeMacBook-Pro-3:bin apple$ mkdir -p combine mkdir: combine: Operation not permitted" it seems like I don't have the permissions.

It looks like you are trying to make the directory in the system bin folder.

You need to be in your home directory:

cd ~
mkdir -p ./bin

This error does not really make sense to me together with the command you used. Please type in exactly these commands, and then make a screenshot from the terminal:

cd ~/
ls -lh
mkdir ~/bin

Which version of macOS are you using?

1 answer

Here's my guess (I don't have a MacOS to test). There is already a file /Users/apple/bin (a file, not a directory) so when you try to make a directory called bin in /Users/apple mkdir fails even if you have -p because you can't replace the file with a directory. I don't know why the comments suggest issues with permissions since in such case the error should be something like "permission denied".

Good catch, that is why I was asking above for the ls.

touch bin
mkdir -p bin
mkdir: bin: Not a directory

Therefore @OP, do rm bin and then repeat making the directory.

Log in to answer this question.