2

I wanted to run a bunch of mkdir commands to create folders:

mkdir -p mydir/animals/mammals/{platypus,bat,dog}
mkdir -p mydir/animals/reptiles/{snakes,crocodile,lizard}
mkdir -p mydir/colors/basic/{red,blue,green}
mkdir -p mydir/colors/blended/{yellow,orange,pink}
mkdir -p mydir/shape/{circle,square,cube}

While running these, I am getting the error

mkdir : invalid option -- 'R'

What is wrong here and how can I fix it?

Byte Commander
  • 110,523
  • Looks quite strange. Can you isolate the actual command causing the error by running each separately? – Byte Commander May 19 '17 at 08:52
  • Are these the exact commands you are running? The only time that error should occur is if you have a letter 'R' after the p – Tim May 19 '17 at 10:07

1 Answers1

1

There are some possibilities.

  1. /usr/bin/mkdir was replaced by another 'mkdir'.
  2. mkdirwas defined as alias.
  3. mkdir was defined as bash function.

Please look it up on bash command line.

type mkdir
alias
muru
  • 207,970
bob293
  • 31
  • 2