MKDIR(1plan9)

πŸ’– MKDIR β€” the 1plan9 manual, but make it a group chat πŸ’–

okay bestie, sit down, hydrate, and let me tell you about the absolute icon that is mkdir from the 1plan9 manual section. yes she's that girl. no cap.


✨ NAME ✨

mkdir β€” make a directory. that's it. that's the whole vibe. she makes directories. πŸ’…


🌸 SYNOPSIS 🌸

mkdir [ -p ] [ -m mode ] dirname ...

like. look at her. minimal. clean. main character energy fr fr. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so mkdir creates the specified directories. that's the whole job. and bestie, to do that she requires write permission in the parent directory. so if the parent folder is locked down and not letting anyone in? she cannot cook. permission check first, always. 🫢

now, if you hand her the -p flag, she gets ✨responsible✨. she'll create any necessary parent directories for you β€” like she's building the whole staircase, not just the one step β€” and she does not complain if the target directory already exists. no drama. no error. just vibes. honestly iconic.

and then there's the -m flag, which sets the permissions to be used when creating the directory. you tell her the mode, she uses the mode. and if you don't say anything? the default is 0777. periodt.


πŸŽ€ SEE ALSO πŸŽ€

  • rm(1) β€” for when you need the opposite energy 😭
  • cd in rc(1) β€” the getting-around move, iykyk

πŸ“ SOURCE πŸ“

the source lives at /src/cmd/mkdir.c in case you wanna read her diary (the source code). go look, she's cute. πŸ“–


πŸ’€ DIAGNOSTICS πŸ’€

here's the vibe check:

  • if all directories were successfully made, mkdir returns null exit status. slay. clean exit. πŸ’…
  • otherwise? she prints a diagnostic and returns "error" status. she will tell you. she is not quiet about it. πŸ™ˆ
lowkey important: exit status matters if you're scripting this, so don't ignore the error status bestie, she's telling you something πŸ”₯

and that's the whole page!! this lil beauty comes from the 1plan9 manual β€” the MKDIR(1plan9) page, header and footer and all πŸŽ€βœ¨ thanks for reading, go make some directories, mwah πŸ’–πŸŒˆ

πŸ“¦ where this page comes from