xref: /curl/docs/cmdline-opts/list-only.md (revision bfe54b0e)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: list-only
5Short: l
6Protocols: FTP POP3 SFTP FILE
7Help: List only mode
8Added: 4.0
9Category: ftp pop3 sftp file
10Multi: boolean
11See-also:
12  - quote
13  - request
14Example:
15  - --list-only ftp://example.com/dir/
16---
17
18# `--list-only`
19
20When listing an FTP directory, force a name-only view. Maybe particularly
21useful if the user wants to machine-parse the contents of an FTP directory
22since the normal directory view does not use a standard look or format. When
23used like this, the option causes an NLST command to be sent to the server
24instead of LIST.
25
26Note: Some FTP servers list only files in their response to NLST; they do not
27include sub-directories and symbolic links.
28
29When listing an SFTP directory, this switch forces a name-only view, one per
30line. This is especially useful if the user wants to machine-parse the
31contents of an SFTP directory since the normal directory view provides more
32information than just filenames.
33
34When retrieving a specific email from POP3, this switch forces a LIST command
35to be performed instead of RETR. This is particularly useful if the user wants
36to see if a specific message-id exists on the server and what size it is.
37
38For FILE, this option has no effect yet as directories are always listed in
39this mode.
40
41Note: When combined with --request, this option can be used to send a UIDL
42command instead, so the user may use the email's unique identifier rather than
43its message-id to make the request.
44