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?

2
  • Looks quite strange. Can you isolate the actual command causing the error by running each separately?
    – Byte Commander
    May 19, 2017 at 8: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, 2017 at 10:07

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .