Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have bash script that works on Ubuntu but for OS X 10.9 i get the error for split command:

split -b 1000000 -a 3 -d $F $F && rm $F || { echo "Error: 'split' command not installed" ; exit 1 ; }

split: illegal option -- d .

According to the split man page, -d is

   -d, --numeric-suffixes
          use numeric suffixes instead of alphabetic

Is there workaround for this?

share|improve this question
up vote 16 down vote accepted

The GNU version of split is different to the OS X version of split.

OS X is based on BSD Unix, and Linux (often referred to as GNU/Linux) uses the GNU toolset.

The GNU version of split is part of the coreutils, and the good news is that these are available in MacPorts. If you have MacPorts installed, you can install the coreutils port using the command:

sudo port install coreutils

This installs the GNU core utilities (including split) with a g prefix, so you call split using the command gsplit.

share|improve this answer
While I know it is possible to install the coreutils with the default names, I would never recommend it since all scripts written for OS X assume that the BSD tools have the 'original' names. – Scott Earle Jul 13 '14 at 15:43
The coreutils are also available via homebrew (also with a 'g' prefix): brew install coreutils – Karl Bartel Mar 11 '15 at 17:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.