Blob


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 .PP
75 The first argument is a command, one of:
76 .TP
77 .B read
78 print the contents of
79 .I path
80 to standard output
81 .TP
82 .B write
83 write data on standard input to
84 .IR path ;
85 the
86 .B -l
87 option causes
88 .I write
89 to write one line at a time
90 .TP
91 .BR readfd ", " writefd
92 like
93 .B read
94 and
95 .B write
96 but use
97 .IR openfd (9p)
98 instead of
99 .IR open ;
100 this masks errors and is mainly useful for debugging
101 the implementation of
102 .I openfd
103 .TP
104 .B stat
105 execute
106 .I stat (9p)
107 on
108 .I path
109 and print the result
110 .TP
111 .B rdwr
112 Open
113 .I path
114 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 Rdwr
120 is useful for interacting with servers like
121 .IR factotum (4).
122 .TP
123 .B ls
124 Print a directory listing in the format of
125 .IR ls (1).
126 The
127 .B -d
128 and
129 .B -l
130 flags have the same meaning as in
131 .IR ls .
132 .PD
133 .PP
134 .I 9p
135 dials
136 .I address
137 to connect to the 9P server.
138 If the
139 .B -a
140 option is not given,
141 .I 9p
142 requires the
143 .I path
144 to be of the form
145 .IB service / subpath \fR;
146 it connects to the Unix domain socket
147 .I service
148 in the name space directory
149 (see
150 .IR intro (4))
151 and then accesses
152 .IR subpath .
153 .SH EXAMPLE
154 To update
155 .IR plumber (4)'s
156 copy of your plumbing rules after editing
157 .BR $HOME/lib/plumbing :
158 .IP
159 .EX
160 cat $HOME/lib/plumbing | 9p write plumb/rules
161 .EE
162 .PP
163 To display the contents of the current
164 .IR acme (4)
165 window:
166 .IP
167 .EX
168 9p read acme/$winid/body
169 .EE
170 .SH SOURCE
171 .B \*9/src/cmd/9p.c
172 .SH SEE ALSO
173 .IR intro (4),
174 .IR intro (9p),
175 .IR 9pclient (3)