curl/docs/cmdline-opts/list-only.md
Colin Leroy-Mira bfe54b0e88
file: add support for getting basic directory listings
Not supported on Windows (yet)

Closes #13137
2024-04-11 12:37:12 +02:00

1.5 KiB

c SPDX-License-Identifier Long Short Protocols Help Added Category Multi See-also Example
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl list-only l FTP POP3 SFTP FILE List only mode 4.0 ftp pop3 sftp file boolean
quote
request
--list-only ftp://example.com/dir/

--list-only

When listing an FTP directory, force a name-only view. Maybe particularly useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view does not use a standard look or format. When used like this, the option causes an NLST command to be sent to the server instead of LIST.

Note: Some FTP servers list only files in their response to NLST; they do not include sub-directories and symbolic links.

When listing an SFTP directory, this switch forces a name-only view, one per line. This is especially useful if the user wants to machine-parse the contents of an SFTP directory since the normal directory view provides more information than just filenames.

When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message-id exists on the server and what size it is.

For FILE, this option has no effect yet as directories are always listed in this mode.

Note: When combined with --request, this option can be used to send a UIDL command instead, so the user may use the email's unique identifier rather than its message-id to make the request.