Jesse
Jesse

Reputation: 39

Getting "file exists" error when trying to create a directory (mkdir)

I'm very new at command line and am having a problem with creating basic directories.

I want to create a directory (let's call it "Blue") inside my documents folder. I am in my Home directory (where my documents folder lives) and expected the following command to do what I wanted

mkdir Blue Documents

However, I get an error message that says "mkdir: Documents: File Exists" and my "Blue" directory is just created under my Home directory.

How should I alter my command to specify that I want the "Blue" directory created under my Documents directory? I am using Terminal on OS X

Upvotes: 0

Views: 3217

Answers (2)

bmcculley
bmcculley

Reputation: 2088

Your syntax is trying to create the Blue and Documents directory right in the home directory.

You can either cd inside the Documents directory or use this syntax:

mkdir Documents/Blue

Upvotes: 1

André Slotta
André Slotta

Reputation: 14040

try this:

mkdir Documents/Blue

Upvotes: 0

Related Questions