DIR (List Directory Entries, Libraries, or Files)

FTP client subcommand

The DIR FTP client subcommand displays libraries and their contents or the remote system's list of directories and directory entries. Use the Directory (DIR) subcommand in this format:

DIr [ name] [(Disk]

name
The name of the directory or library. The default is the entire current directory or library. To make a library or directory current, use the Change Working Directory (CD) subcommand. How you specify a set of remote files depends on the system. Most systems allow a generic asterisk, *. If the remote system is an iSeries™, for example: DIR MYLIB/MYFILE. * produces a list of all members of MYFILE in library MYLIB.

There are two possible file name formats you can use. The example shown here uses NAMEFMT 0. For information about FTP file naming, see NAMEFMT (Select File Naming Format).

(Disk
Stores the results of the DIR subcommand in the file * CURLIB/DIROUTPUT.DIROUTPUT, instead of showing the results on the display.

If the remote system is an iSeries, the information includes:

Use the DIR subcommand with caution. If you enter the DIR subcommand without any parameters, the server produces a listing of all the current directory files. This might be a much longer list than you want.

To get a list of the file names in a directory, use the List (LS) subcommand.

Related reference
CD (Change Working Directory or Library)
NAMEFMT (Select File Naming Format)
LS (List Remote File Names)
File Transfer Protocol client syntax conventions