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.
The manual pages
- Solnix: mkdir(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: mkdir(1) coreutils-full-9.11
- FreeBSD: mkdir(1) 15.1-RELEASE
- OpenBSD: mkdir(1) 8.0
- NetBSD: mkdir(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
mkdir
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 with | Topic | What 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 |
| Linux | long options | Solnix /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 |
| Linux | SELinux 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 |
| Linux | mode of intermediate directories with -p | Linux 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, NetBSD | intermediate directory permissions wording | The 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 four | symbolic -m modes | Linux, 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 four | setgid bit on new directories | The 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 four | owner and group of new directories | The 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/mkdirhas 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
-voption 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
-mmode and-p. Avoid-v,-Zand 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/mkdirexplicitly 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.