rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 1 | .TH 9P 1 |
| 2 | .SH NAME |
| 3 | 9p \- read and write files on a 9P server |
| 4 | .SH SYNOPSIS |
| 5 | .B 9p |
| 6 | [ |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 7 | .I options |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 8 | ] |
| 9 | .B read |
| 10 | .I path |
| 11 | .br |
| 12 | .B 9p |
| 13 | [ |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 14 | .I options |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 15 | ] |
| 16 | .B readfd |
| 17 | .I path |
| 18 | .PP |
| 19 | .B 9p |
| 20 | [ |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 21 | .I options |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 22 | ] |
| 23 | .B write |
rsc | d93fca6 | 2005-02-11 19:21:47 +0000 | [diff] [blame] | 24 | [ |
| 25 | .B -l |
| 26 | ] |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 27 | .I path |
| 28 | .br |
| 29 | .B 9p |
| 30 | [ |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 31 | .I options |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 32 | ] |
| 33 | .B writefd |
| 34 | .I path |
| 35 | .PP |
| 36 | .B 9p |
| 37 | [ |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 38 | .I options |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 39 | ] |
| 40 | .B stat |
| 41 | .I path |
rsc | 30f6ae1 | 2005-02-13 23:44:12 +0000 | [diff] [blame] | 42 | .PP |
| 43 | .B 9p |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 44 | [ |
| 45 | .I options |
| 46 | ] |
rsc | 30f6ae1 | 2005-02-13 23:44:12 +0000 | [diff] [blame] | 47 | .B rdwr |
| 48 | .I path |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 49 | .PP |
| 50 | .B 9p |
| 51 | [ |
| 52 | .I options |
| 53 | ] |
| 54 | .B ls |
| 55 | [ |
| 56 | .B -dl |
| 57 | ] |
| 58 | .I path... |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 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. |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 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 |
Russ Cox | 4ff6950 | 2007-10-12 12:52:52 -0400 | [diff] [blame] | 74 | .TP |
| 75 | .B -n |
| 76 | mount without authentication |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 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 |
rsc | d93fca6 | 2005-02-11 19:21:47 +0000 | [diff] [blame] | 87 | .IR path ; |
| 88 | the |
| 89 | .B -l |
| 90 | option causes |
| 91 | .I write |
| 92 | to write one line at a time |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 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 |
rsc | 30f6ae1 | 2005-02-13 23:44:12 +0000 | [diff] [blame] | 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 | .IR factotum (4). |
rsc | 011090f | 2005-03-21 17:27:25 +0000 | [diff] [blame] | 125 | .TP |
| 126 | .B ls |
| 127 | Print a directory listing in the format of |
| 128 | .IR ls (1). |
| 129 | The |
| 130 | .B -d |
| 131 | and |
| 132 | .B -l |
| 133 | flags have the same meaning as in |
| 134 | .IR ls . |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 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 | .IR intro (4)) |
| 154 | and then accesses |
| 155 | .IR subpath . |
| 156 | .SH EXAMPLE |
| 157 | To update |
| 158 | .IR 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 | .IR acme (4) |
rsc | c8b6342 | 2005-01-13 04:49:19 +0000 | [diff] [blame] | 168 | window: |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 169 | .IP |
| 170 | .EX |
| 171 | 9p read acme/$winid/body |
| 172 | .EE |
| 173 | .SH SOURCE |
rsc | c3674de | 2005-01-11 17:37:33 +0000 | [diff] [blame] | 174 | .B \*9/src/cmd/9p.c |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 175 | .SH SEE ALSO |
| 176 | .IR intro (4), |
| 177 | .IR intro (9p), |
| 178 | .IR 9pclient (3) |