z/OS Communications Server: IP User's Guide and Commands
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


LS subcommand—Obtain a list of file names

z/OS Communications Server: IP User's Guide and Commands
SC27-3662-00

Purpose

Use the LS subcommand to list only the names of a set of remote files, file group, or directory.

Format

Read syntax diagramSkip visual syntax diagram
>>-LS--+------+--+---------+-----------------------------------><
       '-name-'  '-(--Disk-'   

Parameters

name
Specifies the set of remote files whose names are to be listed. The default is the entire current directory or file group.
Disk
Stores the results of the LS subcommand in the user_id.FTP.LSOUTPUT data set. The results are not displayed on the screen.
Note: If the local current working directory is a z/OS® UNIX file system directory, the results are stored in a file named LSOUTPUT.
Restriction: The LISTSUBdir option applies to z/OS UNIX file operations only; MVS™ data set operations are not affected.
Results:
  • If the LISTSUBdir option is not specified on the SITE subcommand and the LISTSUBDIR statement is not specified in the server FTP.DATA file, the default is as if the LISTSUBdir option was specified on the SITE subcommand.
  • If the z/OS FTP server has the NOLISTSUBdir option specified on the SITE subcommand or has LISTSUBDIR FALSE specified in the server FTP.DATA file, an ls * command will list only the files in the current directory.

Examples

Example 1: The following is a sample response that displays after using the LS subcommand.
 >>>PORT 9,67,58,227,4,63
 200 Port request OK.
 >>>NLST
 125 List started OK.
 A.X
 CHR.TXT
 OBEY.TCPIP
 PROFILE.EXEC
 SPF.ISPPROF
 USERTRAN.TCPXLBIN
 250 List completed successfully.
 Command:
The following is a sample entry and the response that displays after using the LS subcommand listing z/OS UNIX files.
cd '/u/user121/ftp.example'
 
 >>>CWD '/u/user121/ftp.example'
 250 HFS directory /u/user121/ftp.example is the current working directory
 Command:
ls
 >>>PORT 9,67,112,25,4,62
 200 Port request OK.
 >>>NLST
 125 List started OK
 append02
 file1
 file2
 file3
 file4
 file5
 250 List completed successfully.
 Command:

Example 2: ls * with SITE LISTSUBdir

Following is an example of ls * with SITE LISTSUBdir. This setting affects processing of the NLST command. The z/OS FTP client sends an NLST command to the server as part of ls * subcommand processing. The LISTSUBdir option specifies that not only the current subdirectory, but also the next subdirectory should be listed as a result of processing an ls * subcommand. In this example, the current directory has a file x and a subdirectory y and subdirectory y has a file x.
site listsubdir
>>> SITE listsubdir
200 SITE command was accepted   
ls *                       
>>> PORT 127,0,0,1,4,17          
200 Port request OK.             
>>> NLST *                       
125 List started OK              
x                                
y/x                              
250 List completed successfully. 
Command:     

Example 3: ls * with SITE NOLISTSUBdir

Following is an example of ls * with SITE NOLISTSUBdir. This setting affects processing of the NLST command. The z/OS FTP client sends an NLST command to the server as part of ls * subcommand processing. The NOLISTSUBdir option specifies that only the current directory should be listed as a result of processing an ls * subcommand. In this example, the current directory has a file x and a subdirectory y and subdirectory y has a file x.
site Nolistsubdir
>>> SITE Nolistsubdir
200 SITE command was accepted   
ls *
>>> PORT 127,0,0,1,4,18         
200 Port request OK.            
>>> NLST                        
125 List started OK             
x                               
y                               
250 List completed successfully.
Command:                        

Usage

  • To make a file group the current working directory, use the CD subcommand. The method you use to specify a directory or file group is host-dependent.
  • You can use special characters for pattern matching when specifying the name. These characters depend on the host FTP server. See DIr subcommand—Obtain a list of directory entries for information about using special characters with the z/OS FTP server.
  • If the current local directory is a PDS, only a member named LSOUTPUT is created. If the current local directory is not a PDS, the local directory, not the user ID, is used as the high-level qualifier for the data set name.
  • If the local current working directory is a z/OS UNIX file system directory, the results are stored in a file named LSOUTPUT.
  • LS lists entries only for data sets and file types that FTP can process (see Specifying data sets and files for a list). GDG base, VSAM, and ATL library entries are among the types not included in the LS output. See DIr subcommand—Obtain a list of directory entries to list entries for all types of data sets or files.

Context

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2013
This information center is Built on Eclipse™ ( www.eclipse.org ).