Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ls - list file names on remote host

&pagelevel(4)&pagelevel

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.

  1. Query the name of the working directory.

    pwd
    257 "/usr/tcptest" is current directory.
    
  2. 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 
    ...
    
  3. 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. 
    ...