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 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 The following commands are recognized by
74 .Nm :
75 .Bl -tag -width Ds
76 .It Ic bell Oo Cm on | off Oc
77 Request terminal to sound a bell after each command.
78 Without arguments toggle the current state.
79 .It Ic bye
80 Terminate the session.
81 Synomym of
82 .Ic quit .
83 .It Ic cd Ar remote-path
84 Change the working directory on the remote machine to
85 .Ar remote-path .
86 .It Ic edit Ar remote-path
87 Download
88 .Ar remote-path
89 and open it with the preferred editor
90 .Po
91 .Ev VISUAL
92 or
93 .Ev EDITOR
94 with
95 .Xr ed 1
96 as fallback
97 .Pc
98 then attempt to re-upload it.
99 .It Ic get Ar remote-file Op Ar local-file
100 Fetch
101 .Ar remote-file
102 and save it locally as
103 .Ar local-file .
104 If
105 .Ar local-file
106 is not given, use the file name from
107 .Ar remote-file .
108 .It Ic hexdump Oo Cm on | off Oc
109 Print the packets sent from/to the server.
110 Without arguments, toggle the current state.
111 .It Ic lcd Op Ar local-directory
112 Change the local current working directory to
113 .Ar local-directory
114 or the
115 .Ev HOME
116 if not given.
117 .It Ic lpwd
118 Print the local working directory.
119 .It Ic ls
120 List the file in the remote current working directory.
121 .It Ic page Ar remote-file
122 Download
123 .Ar remote-file
124 and open it with the
125 .Ev PAGER
126 .Pq Xr less 1 by default .
127 .It Ic pipe Ar remote-file Ar cmd Op Ar args...
128 Fetch
129 .Ar remote-file
130 and pass it as standard input for
131 .Ar cmd
132 (with optional
133 .Ar args Ns ).
134 .It Ic put Ar local-file Op Ar remote-file
135 Upload
136 .Ar local-file
137 to
138 .Ar remote-file .
139 If
140 .Ar remote-file
141 is not given,
142 use the file name from
143 .Ar local-file .
144 .It Ic quit
145 Terminate the session.
146 Synomym of
147 .Ic bye .
148 .It Ic rename Ar remote-file Ar new-remote-name
149 Renames
150 .Ar remote-file
151 to
152 .Ar new-remote-name
153 on the remote server.
154 .It Ic verbose Oo Cm on | off Oc
155 Print verbose information.
156 Without arguments toggle the current state.
157 .El
158 .Sh ENVIRONMENT
159 The following environment variables are inspected:
160 .Bl -tag -width Ds
161 .It Ev HOME
162 The user login directory.
163 .It Ev PAGER
164 The pager to use,
165 .Xr less 1
166 by default.
167 .It Ev VISUAL , Ev EDITOR
168 The program used to edit files.
169 .Ev VISUAL
170 is inspected first,
171 .Ev EDITOR
172 as a fallback.
173 If both are undefined,
174 .Xr ed 1
175 is given some love.
176 .It Ev USER
177 Default login, used if no
178 .Ar user
179 is given on the command line.
180 .El
181 .Sh SEE ALSO
182 .Xr 9p 7 ,
183 .Xr kamid 8
184 .Sh AUTHORS
185 The
186 .Nm
187 utility was written by
188 .An Omar Polo Aq Mt op@omarpolo.com .