[colug-432] mkdir

Scott Merrill skippy at skippy.net
Tue May 12 10:30:22 EDT 2015


> On May 12, 2015, at 10:23 AM, Steve VanSlyck <s.vanslyck at postpro.net> wrote:
> 
> Anyone know what's going on with this? I din't use no stinking option 'a'
>  
> me in /home/me > mkdir -parents -verbose /home/newuser/.ssh
> mkdir: invalid option -- 'a'
> Try 'mkdir --help' for more information.
> me in /home/me >

For most command line tools, there are two kinds of arguments you can pass: short and long.

Short arguments are generally prefixed with a single dash, like “-p”.

Long arguments are generally prefixed with two dashes, like “—verbose”.

Many commands will have short versions and long versions for the same options, but not all programs support this.

If you check the man page for the mkdir command, “man mkdir”, you can see that mkdir does support both long and short options for the “parents” and “vebose” options:

       -p, --parents
              no error if existing, make parent directories as needed

       -v, --verbose
              print a message for each created directory

You need to use one or the other format.  You can’t mix and match the number of dashes.  If you want to use “parents” you need two dashes.  Otherwise, use one dash with “p”.

Cheers,
Scott





More information about the colug-432 mailing list