132
133
INTERACTIVE COMMANDS
133
134
Once in interactive mode, sftp understands a set of commands similar to
134
those of ftp(1). Commands are case insensitive and pathnames may be en-
135
closed in quotes if they contain spaces.
139
cd path Change remote directory to path.
135
those of ftp(1). Commands are case insensitive. Pathnames that contain
136
spaces must be enclosed in quotes. Any special characters contained
137
within pathnames that are recognized by glob(3) must be escaped with
143
Change remote directory to path.
142
Change group of file path to grp. grp must be a numeric GID.
146
Change group of file path to grp. path may contain glob(3) char-
147
acters and may match multiple files. grp must be a numeric GID.
145
Change permissions of file path to mode.
150
Change permissions of file path to mode. path may contain
151
glob(3) characters and may match multiple files.
148
Change owner of file path to own. own must be a numeric UID.
152
get [flags] remote-path [local-path]
153
Retrieve the remote-path and store it on the local machine.
154
If the local path name is not specified, it is given the same
155
name it has on the remote machine. If the -P flag is speci-
156
fied, then the file's full permission and access time are
159
help Display help text.
161
lcd path Change local directory to path.
154
Change owner of file path to own. path may contain glob(3) char-
155
acters and may match multiple files. own must be a numeric UID.
159
get [-P] remote-path [local-path]
160
Retrieve the remote-path and store it on the local machine. If
161
the local path name is not specified, it is given the same name
162
it has on the remote machine. remote-path may contain glob(3)
163
characters and may match multiple files. If it does and local-
164
path is specified, then local-path must specify a directory. If
165
the -P flag is specified, then full file permissions and access
166
times are copied too.
168
help Display help text.
171
Change local directory to path.
163
173
lls [ls-options [path]]
164
Display local directory listing of either path or current di-
165
rectory if path is not specified.
174
Display local directory listing of either path or current direc-
175
tory if path is not specified. ls-options may contain any flags
176
supported by the local system's ls(1) command. path may contain
177
glob(3) characters and may match multiple files.
168
Create local directory specified by path.
180
Create local directory specified by path.
170
182
ln oldpath newpath
171
Create a symbolic link from oldpath to newpath.
173
lpwd Print local working directory.
176
Display remote directory listing of either path or current
177
directory if path is not specified. If the -l flag is speci-
178
fied, then display additional details including permissions
179
and ownership information. The -n flag will produce a long
180
listing with user and group information presented numerical-
183
By default, ls listings are sorted in lexicographical order.
184
This may be changed by specifying the -S (sort by file size),
185
-t (sort by last modification time), or -f (don't sort at
186
all) flags. Additionally, the sort order may be reversed us-
183
Create a symbolic link from oldpath to newpath.
185
lpwd Print local working directory.
187
ls [-1aflnrSt] [path]
188
Display a remote directory listing of either path or the current
189
directory if path is not specified. path may contain glob(3)
190
characters and may match multiple files.
192
The following flags are recognized and alter the behaviour of ls
195
-1 Produce single columnar output.
197
-a List files beginning with a dot (`.').
199
-f Do not sort the listing. The default sort order is lexi-
202
-l Display additional details including permissions and own-
205
-n Produce a long listing with user and group information
206
presented numerically.
208
-r Reverse the sort order of the listing.
210
-S Sort the listing by file size.
212
-t Sort the listing by last modification time.
190
Set local umask to umask.
192
mkdir path Create remote directory specified by path.
194
progress Toggle display of progress meter.
196
put [flags] local-path [remote-path]
197
Upload local-path and store it on the remote machine. If the
198
remote path name is not specified, it is given the same name
199
it has on the local machine. If the -P flag is specified,
200
then the file's full permission and access time are copied
203
pwd Display remote working directory.
215
Set local umask to umask.
218
Create remote directory specified by path.
221
Toggle display of progress meter.
223
put [-P] local-path [remote-path]
224
Upload local-path and store it on the remote machine. If the re-
225
mote path name is not specified, it is given the same name it has
226
on the local machine. local-path may contain glob(3) characters
227
and may match multiple files. If it does and remote-path is
228
specified, then remote-path must specify a directory. If the -P
229
flag is specified, then the file's full permission and access
232
pwd Display remote working directory.
207
236
rename oldpath newpath
208
Rename remote file from oldpath to newpath.
210
rm path Delete remote file specified by path.
212
rmdir path Remove remote directory specified by path.
237
Rename remote file from oldpath to newpath.
240
Delete remote file specified by path.
243
Remove remote directory specified by path.
214
245
symlink oldpath newpath
215
Create a symbolic link from oldpath to newpath.
217
version Display the sftp protocol version.
219
! command Execute command in local shell.
221
! Escape to local shell.
246
Create a symbolic link from oldpath to newpath.
249
Display the sftp protocol version.
252
Execute command in local shell.
254
! Escape to local shell.
226
ftp(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), ssh_config(5),
227
sftp-server(8), sshd(8)
259
ftp(1), ls(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), glob(3),
260
ssh_config(5), sftp-server(8), sshd(8)
229
262
T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-
230
263
filexfer-00.txt, January 2001, work in progress material.
232
OpenBSD 3.6 February 4, 2001 4
265
OpenBSD 3.7 February 4, 2001 4