Use the LISTSUBDIR statement to indicate whether wildcard searches should span subdirectories or apply only to the current working directory. You can use the SIte and LOCSIte subcommands to reset this keyword.
This statement only applies when the asterisk (*) wildcard symbol is used in the filename parameter and the GLOB subcommand is set to expand metacharacters in file names. The ls, mdelete, mget and mput subcommands search only the subdirectories of the current path. They do not search multiple depths of subdirectories.
.-LISTSUBDIR TRUE-------. >>-+-----------------------+----------------------------------->< '-LISTSUBDIR--+-TRUE--+-' '-FALSE-'
areadme (file)
file_xx (file)
readme_xx (file)
ggg (subdirectory)
file_ggg (file)
zzz (subdirectory)
file_zzz (file)
rrr (subdirectory)
250 HFS directory /u/user1/xx is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 40
-rwx------ 1 IBMUSER 0 48 Oct 29 21:14 areadme
-rwx------ 1 IBMUSER 0 10 Nov 1 16:02 file_xx
drwxrwxrwx 3 IBMUSER 0 8192 Nov 1 16:00 ggg
-rwx------ 1 IBMUSER 0 23 Oct 29 21:06 readme_xx
250 List completed successfully.
260 bytes received in 0.03 seconds (8.67 Kbytes/sec)
ftp> cd gg
260 HFS directory /u/user1/xx/ggg is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 24
-rwx------ 1 IBMUSER 0 6 Oct 29 16:00 file_ggg
drwxr-x--- 3 IBMUSER 0 8192 Nov 1 16:01 zzz
250 List completed successfully.
133 bytes received in 0.02 seconds (6.65 Kbytes/sec)
cd zzz
250 HFS directory /u/user1/xx/ggg/zzz is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 24
-rwx------ 1 IBMUSER 0 4 Nov 29 16:00 file_zzz
drwxr-xr-x 3 IBMUSER 0 8192 Nov 1 16:01 rrr
250 List completed successfully.
133 bytes received in 0.01 seconds (13.30 Kbytes/sec)
257 "/u/user1/xx" is the current working directory
ftp> ls *
200 Port request OK.
125 List started OK
areadme
file_xx
readme_xx
250 List completed successfully.
29 bytes received in 0.02 seconds (1.45 Kbytes/sec)
257 "/u/user1/xx" is the HFS working directory
ftp> ls *
200 Port request OK.
125 List started OK
areadme
file_xx
ggg/file_ggg
readme_xx
250 List completed successfully.
42 bytes received in 0.04 seconds (1.05 Kbytes/sec)
When
spanning subdirectories with the wildcard *, the file ggg/file_ggg
is shown. However, the file ggg/file_zzz is not shown because the
subdirectory span is only one level deep.Restriction: The LISTSUBDIR statement applies to z/OS UNIX file operations only. MVS™ data set operations are not affected.