Blob
1 .TH 9P 12 .SH NAME3 9p \- read and write files on a 9P server4 .SH SYNOPSIS5 .B 9p6 [7 .I options8 ]9 .B read10 .I path11 .br12 .B 9p13 [14 .I options15 ]16 .B readfd17 .I path18 .PP19 .B 9p20 [21 .I options22 ]23 .B write24 [25 .B -l26 ]27 .I path28 .br29 .B 9p30 [31 .I options32 ]33 .B writefd34 .I path35 .PP36 .B 9p37 [38 .I options39 ]40 .B stat41 .I path42 .PP43 .B 9p44 [45 .I options46 ]47 .B rdwr48 .I path49 .PP50 .B 9p51 [52 .I options53 ]54 .B ls55 [56 .B -dl57 ]58 .I path...59 .SH DESCRIPTION60 .I 9p61 is a trivial 9P client that can access a single file on a 9P server.62 It can be useful for manual interaction with a 9P server or for63 accessing simple 9P services from within shell scripts.64 The common options are:65 .TP66 .B -a\fI addr67 dial68 the server at69 .I addr70 .TP71 .B -A\fI aname72 attach to the file system named73 .I aname74 .PP75 The first argument is a command, one of:76 .TP77 .B read78 print the contents of79 .I path80 to standard output81 .TP82 .B write83 write data on standard input to84 .IR path ;85 the86 .B -l87 option causes88 .I write89 to write one line at a time90 .TP91 .BR readfd ", " writefd92 like93 .B read94 and95 .B write96 but use97 .IR openfd (9p)98 instead of99 .IR open ;100 this masks errors and is mainly useful for debugging101 the implementation of102 .I openfd103 .TP104 .B stat105 execute106 .I stat (9p)107 on108 .I path109 and print the result110 .TP111 .B rdwr112 Open113 .I path114 for reading and writing.115 Then repeat until end-of-file on standard input:116 copy a line from the file to standard output,117 copy a line from standard input to the file.118 Print errors, but don't give up.119 .B Rdwr120 is useful for interacting with servers like121 .IR factotum (4).122 .TP123 .B ls124 Print a directory listing in the format of125 .IR ls (1).126 The127 .B -d128 and129 .B -l130 flags have the same meaning as in131 .IR ls .132 .PD133 .PP134 .I 9p135 dials136 .I address137 to connect to the 9P server.138 If the139 .B -a140 option is not given,141 .I 9p142 requires the143 .I path144 to be of the form145 .IB service / subpath \fR;146 it connects to the Unix domain socket147 .I service148 in the name space directory149 (see150 .IR intro (4))151 and then accesses152 .IR subpath .153 .SH EXAMPLE154 To update155 .IR plumber (4)'s156 copy of your plumbing rules after editing157 .BR $HOME/lib/plumbing :158 .IP159 .EX160 cat $HOME/lib/plumbing | 9p write plumb/rules161 .EE162 .PP163 To display the contents of the current164 .IR acme (4)165 window:166 .IP167 .EX168 9p read acme/$winid/body169 .EE170 .SH SOURCE171 .B \*9/src/cmd/9p.c172 .SH SEE ALSO173 .IR intro (4),174 .IR intro (9p),175 .IR 9pclient (3)