The ls command lists file names on the remote host. Information on remote files can also be obtained by using the dir, mdir and mls commands.
ls |
[<remote-file>] [<local-file>]] |
<remote-file>
Name of a file on the remote host. If this operand is omitted, a list of all the files in the current working directory of the remote host is returned.
<local-file>
Name of the local file to which the output from the command is to be written. If this operand is not specified, the output is sent to the terminal.
Example
The remote host is a Unix host.
Query the name of the working directory.
pwd 257 "/usr/tcptest" is current directory.
List the files in the working directory on the screen. The FTP server function PORT is called implicitly.
ls 200 PORT command okay. ... FIL.files FIL.tools FTP TELNET TU man pool backup ...
List the remote files designated by FIL.* and pipe the output to the local file fil.prot.
ls FIL.* fil.prot 200 PORT command okay. ...