The mlst command lists the file properties on the remote host using the MLST FTP server command, which returns data in a machine-readable format (see RFC 3659). It is therefore not aimed quite so much at human users, but it is especially suited for use within procedures. Unlike the mlsd command, information is not returned via a separate data connection, but via the control connection, because it only returns information on a single file in each case.
The scope of output can be modified using the OPTS FTP server command (for details, see RFC 3659): A quote OPTS MLST; means that mlsd and mlst list only the file name(s). After a quote OPTS MLST modify;size;, the size, date of change, and file name are listed.
mlst |
[<remote-file>] |
<remote-file>
Name of a file on the remote host.
Example
The remote host is a BS2000 host.
Query the name of the working directory.
pwd 257 ":2OSG:$TSOS." is current directory.
Query the file properties of a file.
mlst SYSENT.TCP-IP-AP.nnn.FTPD 250-Listing SYSENT.TCP-IP-AP.nnn.FTPD type=file;perm=fr;size=2048;create=20161220175301;modify=20161220175301; SYSENT.TCP-IP-AP.nnn.FTPD 250 End
Reduce the output scope.
quote OPTS MLST modify;size; 200 MLST OPTS size;modify;
Query the file properties again.
mlst SYSENT.TCP-IP-AP.nnn.FTPD 250-Listing SYSENT.TCP-IP-AP.nnn.FTPD size=2048;modify=20161220175301; SYSENT.TCP-IP-AP.nnn.FTPD 250 End