9p.1 (2319B)
1 .TH 9P 1 2 .SH NAME 3 9p \- read and write files on a 9P server 4 .SH SYNOPSIS 5 .B 9p 6 [ 7 .I options 8 ] 9 .B read 10 .I path 11 .br 12 .B 9p 13 [ 14 .I options 15 ] 16 .B readfd 17 .I path 18 .PP 19 .B 9p 20 [ 21 .I options 22 ] 23 .B write 24 [ 25 .B -l 26 ] 27 .I path 28 .br 29 .B 9p 30 [ 31 .I options 32 ] 33 .B writefd 34 .I path 35 .PP 36 .B 9p 37 [ 38 .I options 39 ] 40 .B stat 41 .I path 42 .PP 43 .B 9p 44 [ 45 .I options 46 ] 47 .B rdwr 48 .I path 49 .PP 50 .B 9p 51 [ 52 .I options 53 ] 54 .B ls 55 [ 56 .B -dl 57 ] 58 .I path... 59 .SH DESCRIPTION 60 .I 9p 61 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 for 63 accessing simple 9P services from within shell scripts. 64 The common options are: 65 .TP 66 .B -a\fI addr 67 dial 68 the server at 69 .I addr 70 .TP 71 .B -A\fI aname 72 attach to the file system named 73 .I aname 74 .TP 75 .B -n 76 mount without authentication 77 .PP 78 The first argument is a command, one of: 79 .TP 80 .B read 81 print the contents of 82 .I path 83 to standard output 84 .TP 85 .B write 86 write data on standard input to 87 .IR path ; 88 the 89 .B -l 90 option causes 91 .I write 92 to write one line at a time 93 .TP 94 .BR readfd ", " writefd 95 like 96 .B read 97 and 98 .B write 99 but use 100 .IR openfd (9p) 101 instead of 102 .IR open ; 103 this masks errors and is mainly useful for debugging 104 the implementation of 105 .I openfd 106 .TP 107 .B stat 108 execute 109 .I stat (9p) 110 on 111 .I path 112 and print the result 113 .TP 114 .B rdwr 115 Open 116 .I path 117 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 Rdwr 123 is useful for interacting with servers like 124 .MR factotum (4) . 125 .TP 126 .B ls 127 Print a directory listing in the format of 128 .MR ls (1) . 129 The 130 .B -d 131 and 132 .B -l 133 flags have the same meaning as in 134 .IR ls . 135 .PD 136 .PP 137 .I 9p 138 dials 139 .I address 140 to connect to the 9P server. 141 If the 142 .B -a 143 option is not given, 144 .I 9p 145 requires the 146 .I path 147 to be of the form 148 .IB service / subpath \fR; 149 it connects to the Unix domain socket 150 .I service 151 in the name space directory 152 (see 153 .MR intro (4) ) 154 and then accesses 155 .IR subpath . 156 .SH EXAMPLE 157 To update 158 .MR plumber (4) 's 159 copy of your plumbing rules after editing 160 .BR $HOME/lib/plumbing : 161 .IP 162 .EX 163 cat $HOME/lib/plumbing | 9p write plumb/rules 164 .EE 165 .PP 166 To display the contents of the current 167 .MR acme (4) 168 window: 169 .IP 170 .EX 171 9p read acme/$winid/body 172 .EE 173 .SH SOURCE 174 .B \*9/src/cmd/9p.c 175 .SH SEE ALSO 176 .MR intro (4) , 177 .IR intro (9p), 178 .MR 9pclient (3)