Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.86 KB

d2d.md

File metadata and controls

58 lines (41 loc) · 2.86 KB

Useful day-to-day stuff

Use man [section] title to search for the manual page title in section, or lookman key to search for all manual pages that contain key.

Pressing Control-D in Rio generates an EOT character, which is like a newline, but it is not delivered to the running program. An EOT serves as EOF indication. Control-D in Plan 9 has a similar effect to Control-C in Unix.

Text processing and stream I/O

  • echo - write text to stdout
  • cat - concatenate files
  • grep - pattern search
  • sed - edit stream
  • awk - scan and process
  • wc - count words

System administration

  • ip/ping - ping a device
  • ps - print information about running processes
  • fshalt - halt file system and shut down the machine
  • reboot - reboot the system

File system

  • file - classify file
  • bind - bind a source file to a destination file, so that the destination is an alias for the source
  • mount - mount (i.e. "attach") the contents of a directory tree to another directory tree
  • unmount - undo bind or mount
  • 9fs - dial a machine and mount its file system
  • ns - represent the name spaces of a process
  • rcpu - connect to a CPU server and start a shell on it
  • rimport - connect to a CPU server and mount a directory tree from it
  • rexport - connect to a CPU server and mount a local directory tree into it

Name spaces

What are name spaces?

Across the file system there are many mount points. A detailed list is available in namespace(4).

Directories that contain mount points for synthetic file trees are:

  • /n - mount points imported by remote systems
  • /mnt - mount points generated by other processes
  • /srv - connections to file servers, held by the service registry
  • /shr - mounted file systems available to all name spaces, also called the global mount point device

Other synthetic file trees are:

  • /dev - I/O devices
  • /net - network devices
  • /env - environment variables
  • /proc - active processes
  • /fd - open file descriptors

Plan 9 provides a default name space to processes as soon as they spawn. To see details of the default name space, open a new Rc session and use the ns command.

To edit the default name space, edit the /lib/namespace file.