mkdir(1) on Solnix vs Linux and the BSDs

On Solnix, mkdir is the illumos /usr/bin/mkdir, which takes only -m and -p. Linux (GNU) and FreeBSD add -v, and Linux also adds long options and SELinux flags. None of these exist in /usr/bin/mkdir on Solnix.

What Solnix runs

A default Solnix system runs the illumos /usr/bin/mkdir, and no other variants are shipped. The page also documents a ksh93 mkdir built-in. ksh93 uses it when mkdir is run without a path prefix and the search finds /bin/mkdir or /usr/bin/mkdir. The built-in accepts --mode and --parents. Calling /usr/bin/mkdir by full path runs the external command, which has no long options.

Differences

Compared withTopicWhat differs
Linux, FreeBSD-v (verbose)Solnix /usr/bin/mkdir has no -v, and the ksh93 built-in documents none either. Linux and FreeBSD -v print each directory as it is created. FreeBSD calls -v non-standard and advises against using it in scripts.
Source: Solnix mkdir(1) SYNOPSIS, OPTIONS; Linux mkdir(1) -v, --verbose; FreeBSD mkdir(1) -v, COMPATIBILITY
Linuxlong optionsSolnix /usr/bin/mkdir has no long options. Only the ksh93 built-in accepts --mode and --parents. Linux accepts --mode, --parents, --verbose, --context, --help and --version. A script using --help or --version fails on /usr/bin/mkdir.
Source: Solnix mkdir(1) OPTIONS (/usr/bin/mkdir, ksh93); Linux mkdir(1) DESCRIPTION
LinuxSELinux context (-Z, --context)Linux mkdir can set the SELinux or SMACK security context of new directories with -Z or --context[=CTX]. The Solnix page documents no equivalent, and neither do the BSD pages.
Source: Linux mkdir(1) -Z, --context; Solnix mkdir(1) OPTIONS
Linuxmode of intermediate directories with -pLinux says -p creates parents with file modes unaffected by any -m option. Solnix /usr/bin/mkdir gives intermediate directories 777 minus the umask, with at least 300 (user write and execute). The page does not say how -m interacts with this.
Source: Linux mkdir(1) -p; Solnix mkdir(1) OPTIONS -p (/usr/bin/mkdir)
FreeBSD, OpenBSD, NetBSDintermediate directory permissions wordingThe BSD pages say intermediate directories get 0777 as modified by the umask, plus write and search permission for the owner. Solnix /usr/bin/mkdir expresses this as 777 minus the umask, but at least 300. The two descriptions look equivalent but are worded differently.
Source: FreeBSD mkdir(1) -p; OpenBSD mkdir(1) -p; NetBSD mkdir(1) -p; Solnix mkdir(1) OPTIONS -p
all foursymbolic -m modesLinux, FreeBSD, OpenBSD, NetBSD and the Solnix ksh93 built-in all say symbolic modes start from a=rwx. The Solnix /usr/bin/mkdir page only refers to chmod(1) for the mode syntax. It does not state the initial mode for relative modes such as u+w.
Source: Solnix mkdir(1) OPTIONS -m (/usr/bin/mkdir vs ksh93); Linux mkdir(1) -m; FreeBSD mkdir(1) -m; OpenBSD mkdir(1) -m; NetBSD mkdir(1) -m
all foursetgid bit on new directoriesThe Solnix page says new directories inherit the setgid bit from the parent. To change it you must run chmod g+s or g-s after mkdir. The other pages do not describe setgid behaviour.
Source: Solnix mkdir(1) DESCRIPTION (setgid and mkdir); Linux, FreeBSD, OpenBSD and NetBSD mkdir(1) DESCRIPTION
all fourowner and group of new directoriesThe Solnix page states that new directories get the process's effective user ID and group ID. The Linux and BSD pages in the bundle do not say.
Source: Solnix mkdir(1) DESCRIPTION; Linux, FreeBSD, OpenBSD and NetBSD mkdir(1) DESCRIPTION

Standards

  • POSIX: mkdir is a POSIX.1-2024 utility.
  • Solnix: ATTRIBUTES: /usr/bin/mkdir has Interface Stability Committed and Standard "See standards(7)". The ksh93 built-in lists Interface Stability as "See below", and the bundle text is cut off before that point.
  • FreeBSD: mkdir is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible. The -v option is non-standard.
  • OpenBSD: mkdir is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
  • NetBSD: mkdir is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
  • Linux: The Linux page in the bundle has no STANDARDS section.

Writing portable scripts

  • Use only -m mode and -p. Avoid -v, -Z and the long options, which exist only on some systems.
  • If you need a verbose message, print it yourself instead of using -v.
  • In ksh93 scripts on Solnix, mkdir may resolve to the built-in. Call /usr/bin/mkdir explicitly if you need the external command's behaviour.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.