Blob


1 .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
2 .\"
3 .\" Permission to use, copy, modify, and distribute this software for any
4 .\" purpose with or without fee is hereby granted, provided that the above
5 .\" copyright notice and this permission notice appear in all copies.
6 .\"
7 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 .\"
15 .Dd $Mdocdate: November 23 2022 $
16 .Dt KAMIFTP 1
17 .Os
18 .Sh NAME
19 .Nm kamiftp
20 .Nd 9p client
21 .Sh SYNOPSIS
22 .Nm
23 .Op Fl C Ar cert
24 .Op Fl K Ar key
25 .Op Fl o Ar output
26 .Oo 9p:// Oc Ns Oo Ar user Ns @ Oc Ns Ar host Ns Oo : Ns Ar port Oc Ns Op / Ns Ar path
27 .Sh DESCRIPTION
28 .Nm
29 is a
30 .Xr 9p 7
31 client.
32 If
33 .Ar path
34 names a remote file,
35 .Nm
36 downloads it in the current directory and exit, otherwise changes the
37 remote working directory and starts accepting commands.
38 .Pp
39 The options are as follows:
40 .Bl -tag -width Ds
41 If used,
42 .Fl C
43 is mandatory.
44 .It Fl C Ar certificate
45 Connect with TLS to the remote server and use the given
46 .Ar certificate
47 during the TLS handsahke.
48 .It Fl K Ar key
49 Specify the path to the client certificate
50 .Ar key
51 to be used during the TLS handshake.
52 If not given, the file passed to
53 .Fl C
54 will be used.
55 If used,
56 .Fl C
57 must be provided too.
58 .It Fl o Ar output
59 When fetching the file specified to the command line,
60 save its content in
61 .Ar output .
62 To write the content to standard output, use
63 .Sq - .
64 It's an error to specify
65 .Fl o
66 when not givin a
67 .Ar path
68 or when
69 .Ar path
70 names a directory.
71 .El
72 .Pp
73 .Nm
74 parses the input similarly to
75 .Xr sh .
76 Words are splitted on spaces, multiple spaces are collapsed into one.
77 Quoting with
78 .Sq '
79 or
80 .Sq \&"
81 can be used to preserve spaces and other quotes.
82 .Sq \e
83 can be used to quote the following character.
84 No special meaning is given to
85 .Sq \e
86 sequences
87 .Po i.e.\& Sq \en
88 is just the
89 .Sq n
90 character
91 .Pc .
92 .Pp
93 The following commands are recognized by
94 .Nm :
95 .Bl -tag -width Ds
96 .It Ic bell Oo Cm on | off Oc
97 Request terminal to sound a bell after each command.
98 Without arguments toggle the current state.
99 .It Ic bye
100 Terminate the session.
101 Synomym of
102 .Ic quit .
103 .It Ic cd Ar remote-path
104 Change the working directory on the remote machine to
105 .Ar remote-path .
106 .It Ic edit Ar remote-path
107 Download
108 .Ar remote-path
109 and open it with the preferred editor
110 .Po
111 .Ev VISUAL
112 or
113 .Ev EDITOR
114 with
115 .Xr ed 1
116 as fallback
117 .Pc
118 then attempt to re-upload it.
119 .It Ic get Ar remote-file Op Ar local-file
120 Fetch
121 .Ar remote-file
122 and save it locally as
123 .Ar local-file .
124 If
125 .Ar local-file
126 is not given, use the file name from
127 .Ar remote-file .
128 .It Ic hexdump Oo Cm on | off Oc
129 Print the packets sent from/to the server.
130 Without arguments, toggle the current state.
131 .It Ic lcd Op Ar local-directory
132 Change the local current working directory to
133 .Ar local-directory
134 or the
135 .Ev HOME
136 if not given.
137 .It Ic lpwd
138 Print the local working directory.
139 .It Ic ls Op Ar path
140 List the file in the remote current working directory or
141 .Ar path
142 if provided.
143 .It Ic page Ar remote-file
144 Download
145 .Ar remote-file
146 and open it with the
147 .Ev PAGER
148 .Pq Xr less 1 by default .
149 .It Ic pipe Ar remote-file Ar cmd Op Ar args...
150 Fetch
151 .Ar remote-file
152 and pass it as standard input for
153 .Ar cmd
154 (with optional
155 .Ar args Ns ).
156 .It Ic put Ar local-file Op Ar remote-file
157 Upload
158 .Ar local-file
159 to
160 .Ar remote-file .
161 If
162 .Ar remote-file
163 is not given,
164 use the file name from
165 .Ar local-file .
166 .It Ic quit
167 Terminate the session.
168 Synomym of
169 .Ic bye .
170 .It Ic rename Ar remote-file Ar new-remote-name
171 Renames
172 .Ar remote-file
173 to
174 .Ar new-remote-name
175 on the remote server.
176 .It Ic rm Ar
177 Remove the remote files.
178 .It Ic verbose Oo Cm on | off Oc
179 Print verbose information.
180 Without arguments toggle the current state.
181 .El
182 .Sh ENVIRONMENT
183 The following environment variables are inspected:
184 .Bl -tag -width Ds
185 .It Ev HOME
186 The user login directory.
187 .It Ev PAGER
188 The pager to use,
189 .Xr less 1
190 by default.
191 .It Ev VISUAL , Ev EDITOR
192 The program used to edit files.
193 .Ev VISUAL
194 is inspected first,
195 .Ev EDITOR
196 as a fallback.
197 If both are undefined,
198 .Xr ed 1
199 is given some love.
200 .It Ev USER
201 Default login, used if no
202 .Ar user
203 is given on the command line.
204 .El
205 .Sh SEE ALSO
206 .Xr 9p 7 ,
207 .Xr kamid 8
208 .Sh AUTHORS
209 The
210 .Nm
211 utility was written by
212 .An Omar Polo Aq Mt op@omarpolo.com .