25.02.2013 Views

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

File manipulation<br />

The following comm<strong>and</strong>s provide the ability to not only transfer files, but also to<br />

delete <strong>and</strong> rename files:<br />

get [-P] remote-path [local-path]<br />

Retrieves the file specified by remote-path <strong>and</strong> stores it<br />

on the local machine. If the local-path name is not<br />

specified, it is given the same name it has on the remote<br />

machine. If the -P flag is specified, the file's full<br />

permission <strong>and</strong> access time are copied, too.<br />

put [-P] local-path [local-path]<br />

Uploads the file specified by local-path <strong>and</strong> stores it on<br />

the remote host using the name specified by remote-path.<br />

If the remote-path name is not specified, it is given the<br />

same name it has on the local machine. If the -P flag is<br />

specified, the file's full permission <strong>and</strong> access time are<br />

copied, too.<br />

rename oldpath newpath<br />

Renames the remote file from oldpath to newpath.<br />

rm path Deletes the remote file specified by path.<br />

Obtaining information<br />

Use the following comm<strong>and</strong>s to obtain information in the SFTP session:<br />

help Displays help text.<br />

lls [path] Displays the local directory listing of either the specified<br />

path, or current directory if path is not specified.<br />

lpwd Prints the local working directory.<br />

ls [-l] [path] Displays the remote directory listing of either the specified<br />

path, or the current directory if path is not specified. If the<br />

-l flag is specified, it displays additional details including<br />

permissions <strong>and</strong> ownership information.<br />

pwd Displays remote working directory.<br />

? Synonym for help.<br />

Shell manipulation<br />

Because SFTP is built on the secure shell environment, users might need to<br />

obtain information about the shell, or issue shell comm<strong>and</strong>s without terminating<br />

SFTP. For this, use the following comm<strong>and</strong>s:<br />

chgrp grp path Changes the group of the file specified by path to grp. grp<br />

must be a numeric GID.<br />

Chapter 14. File-related protocols 537

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!