IMPORT(4)
π IMPORT(4) β bestie edition
ok so you're reading import from section 4 of the Kernel Interfaces Manual, and honestly? she's that girl. this is the page where your local machine learns to borrow another machine's stuff. let's get into it π«Ά
β¨ NAME β¨
import β import 9P resources from another system π¦
β¨ SYNOPSIS β¨
import [ -dfx ] [ -n ns ] [ -p prog ] [ -s service ] system
β¨ DESCRIPTION β¨
okay so here's the whole vibe: import takes the 9P service service β and if you don't say which one, it defaults to plumb, no cap β running over on system, and presents it as a service on your local system, inside the current name space. it's giving "you're here but also you're there" π«
The -n option sets the remote name space directory, like, the place where import should expect to find service. if you just don't specify it? import uses the name of the local system's name space directory instead. and lowkey heads up: since name space directories conventionally live inside /tmp, that path is gonna mean different things on the two systems β same string, two different realities, iykyk π
import connects to system using ssh(1). yep, ssh does the heavy lifting. it invokes import on the remote system to carry out the remote side of the protocol β teamwork, bestie π€ The -p option specifies the path to import on the remote system, for the case where it's just not chilling in the system search path.
The -d option turns on debugging π and the -f option keeps import from forking itself into the background β also iconic for debugging, because sometimes you want her to stay right there and explain herself.
The -x option flips the whole thing: it reverses the roles of the two machines, exporting the service to the remote system instead of importing it from there. plot twist π
β¨ EXAMPLE β¨
so picture this: you run sam -r to the CPU server anna. Sam wants to talk to a plumber on the local terminal, but the file names are gonna refer to files over on anna. awkward π
to fix this problem, you create a new name space directory and start a new plumber on anna:
remotens=/tmp/ns.`whoami`.on.`hostname`
ssh anna mkdir $remotens
ssh anna NAMESPACE=$remotens plumber
now import that plumber to the local name space before starting sam and 9term:
NAMESPACE=/tmp/ns.anna
mkdir $NAMESPACE
import -n $remotens -s plumb anna
sam &
9term ssh anna &
slay. plumber imported, name spaces sorted, everything connected π β¨
β¨ SOURCE β¨
/src/cmd/import.c
β¨ SEE ALSO β¨
πΈ friendly reminder thatimportrunsimporton the remote side overssh(1)β so if things get weird,-dis your bestie and-fkeeps her from wandering off into the background mid-debug. π
and that's the whole page, bestie! π this little cutie is IMPORT(4) from the Kernel Interfaces Manual β the source file lives at /src/cmd/import.c, and the footer just says IMPORT(4) again because the man page wanted to sign off with her own name, main character energy only π
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms