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 .TP75 .B -n76 mount without authentication77 .PP78 The first argument is a command, one of:79 .TP80 .B read81 print the contents of82 .I path83 to standard output84 .TP85 .B write86 write data on standard input to87 .IR path ;88 the89 .B -l90 option causes91 .I write92 to write one line at a time93 .TP94 .BR readfd ", " writefd95 like96 .B read97 and98 .B write99 but use100 .IR openfd (9p)101 instead of102 .IR open ;103 this masks errors and is mainly useful for debugging104 the implementation of105 .I openfd106 .TP107 .B stat108 execute109 .I stat (9p)110 on111 .I path112 and print the result113 .TP114 .B rdwr115 Open116 .I path117 for reading and writing.118 Then repeat until end-of-file on standard input:119 copy a line from the file to standard output,120 copy a line from standard input to the file.121 Print errors, but don't give up.122 .B Rdwr123 is useful for interacting with servers like124 .IR factotum (4).125 .TP126 .B ls127 Print a directory listing in the format of128 .IR ls (1).129 The130 .B -d131 and132 .B -l133 flags have the same meaning as in134 .IR ls .135 .PD136 .PP137 .I 9p138 dials139 .I address140 to connect to the 9P server.141 If the142 .B -a143 option is not given,144 .I 9p145 requires the146 .I path147 to be of the form148 .IB service / subpath \fR;149 it connects to the Unix domain socket150 .I service151 in the name space directory152 (see153 .IR intro (4))154 and then accesses155 .IR subpath .156 .SH EXAMPLE157 To update158 .IR plumber (4)'s159 copy of your plumbing rules after editing160 .BR $HOME/lib/plumbing :161 .IP162 .EX163 cat $HOME/lib/plumbing | 9p write plumb/rules164 .EE165 .PP166 To display the contents of the current167 .IR acme (4)168 window:169 .IP170 .EX171 9p read acme/$winid/body172 .EE173 .SH SOURCE174 .B \*9/src/cmd/9p.c175 .SH SEE ALSO176 .IR intro (4),177 .IR intro (9p),178 .IR 9pclient (3)