blob: 762e7220572197e604c001da34ca3ec15e5893d3 [file] [log] [blame]
rsc058b0112005-01-03 06:40:20 +00001.TH 9P 1
2.SH NAME
39p \- read and write files on a 9P server
4.SH SYNOPSIS
5.B 9p
6[
rsc011090f2005-03-21 17:27:25 +00007.I options
rsc058b0112005-01-03 06:40:20 +00008]
9.B read
10.I path
11.br
12.B 9p
13[
rsc011090f2005-03-21 17:27:25 +000014.I options
rsc058b0112005-01-03 06:40:20 +000015]
16.B readfd
17.I path
18.PP
19.B 9p
20[
rsc011090f2005-03-21 17:27:25 +000021.I options
rsc058b0112005-01-03 06:40:20 +000022]
23.B write
rscd93fca62005-02-11 19:21:47 +000024[
25.B -l
26]
rsc058b0112005-01-03 06:40:20 +000027.I path
28.br
29.B 9p
30[
rsc011090f2005-03-21 17:27:25 +000031.I options
rsc058b0112005-01-03 06:40:20 +000032]
33.B writefd
34.I path
35.PP
36.B 9p
37[
rsc011090f2005-03-21 17:27:25 +000038.I options
rsc058b0112005-01-03 06:40:20 +000039]
40.B stat
41.I path
rsc30f6ae12005-02-13 23:44:12 +000042.PP
43.B 9p
rsc011090f2005-03-21 17:27:25 +000044[
45.I options
46]
rsc30f6ae12005-02-13 23:44:12 +000047.B rdwr
48.I path
rsc011090f2005-03-21 17:27:25 +000049.PP
50.B 9p
51[
52.I options
53]
54.B ls
55[
56.B -dl
57]
58.I path...
rsc058b0112005-01-03 06:40:20 +000059.SH DESCRIPTION
60.I 9p
61is a trivial 9P client that can access a single file on a 9P server.
62It can be useful for manual interaction with a 9P server or for
63accessing simple 9P services from within shell scripts.
rsc011090f2005-03-21 17:27:25 +000064The common options are:
65.TP
66.B -a\fI addr
67dial
68the server at
69.I addr
70.TP
71.B -A\fI aname
72attach to the file system named
73.I aname
Russ Cox4ff69502007-10-12 12:52:52 -040074.TP
75.B -n
76mount without authentication
rsc058b0112005-01-03 06:40:20 +000077.PP
78The first argument is a command, one of:
79.TP
80.B read
81print the contents of
82.I path
83to standard output
84.TP
85.B write
86write data on standard input to
rscd93fca62005-02-11 19:21:47 +000087.IR path ;
88the
89.B -l
90option causes
91.I write
92to write one line at a time
rsc058b0112005-01-03 06:40:20 +000093.TP
94.BR readfd ", " writefd
95like
96.B read
97and
98.B write
99but use
100.IR openfd (9p)
101instead of
102.IR open ;
103this masks errors and is mainly useful for debugging
104the implementation of
105.I openfd
106.TP
107.B stat
108execute
109.I stat (9p)
110on
111.I path
112and print the result
rsc30f6ae12005-02-13 23:44:12 +0000113.TP
114.B rdwr
115Open
116.I path
117for reading and writing.
118Then repeat until end-of-file on standard input:
119copy a line from the file to standard output,
120copy a line from standard input to the file.
121Print errors, but don't give up.
122.B Rdwr
123is useful for interacting with servers like
124.IR factotum (4).
rsc011090f2005-03-21 17:27:25 +0000125.TP
126.B ls
127Print a directory listing in the format of
128.IR ls (1).
129The
130.B -d
131and
132.B -l
133flags have the same meaning as in
134.IR ls .
rsc058b0112005-01-03 06:40:20 +0000135.PD
136.PP
137.I 9p
138dials
139.I address
140to connect to the 9P server.
141If the
142.B -a
143option is not given,
144.I 9p
145requires the
146.I path
147to be of the form
148.IB service / subpath \fR;
149it connects to the Unix domain socket
150.I service
151in the name space directory
152(see
153.IR intro (4))
154and then accesses
155.IR subpath .
156.SH EXAMPLE
157To update
158.IR plumber (4)'s
159copy of your plumbing rules after editing
160.BR $HOME/lib/plumbing :
161.IP
162.EX
163cat $HOME/lib/plumbing | 9p write plumb/rules
164.EE
165.PP
166To display the contents of the current
167.IR acme (4)
rscc8b63422005-01-13 04:49:19 +0000168window:
rsc058b0112005-01-03 06:40:20 +0000169.IP
170.EX
1719p read acme/$winid/body
172.EE
173.SH SOURCE
rscc3674de2005-01-11 17:37:33 +0000174.B \*9/src/cmd/9p.c
rsc058b0112005-01-03 06:40:20 +0000175.SH SEE ALSO
176.IR intro (4),
177.IR intro (9p),
178.IR 9pclient (3)