Use port number
XX
instead of the default FTP service port (21).
-d XX
Use the file
XX
for debug logging.
-t XX
Timeout after
XX
seconds.
-E
Use regular (PORT) data connections.
-F
Use passive (PASV) data connections.
The default is to use passive, but to fallback to
regular if the passive connection fails or times out.
-r XX
Redial a maximum of
XX
times until connected to the remote FTP server.
-W XX
Send raw FTP command
XX
after logging in.
-X XX
Send raw FTP command
XX
after each file transferred.
-Y XX
Send raw FTP command
XX
before logging out.
The
-W, -X, and -Y
options are useful for advanced users who need to tweak
behavior on some servers.
For example, users accessing mainframes might need to send
some special SITE commands to set blocksize and record format information.
For these options, you can use them multiple times each if you need
to send multiple commands.
For the
-X
option, you can use the cookie
%s
to expand into the name of the file that was transferred.
DESCRIPTION
The
purpose of
ncftpls
is to do remote directory listings using
the File Transfer Protocol without entering an interactive shell.
This lets you write shell scripts or other unattended
processes that can do FTP.
The default behavior is to print the directory listing in columnized
format (i.e. ls -CF), but that is not very useful for scripting.
This example uses the
-1
flag, to print one file per line:
You can also do a remote "ls -l", by using "ncftpls -l".
If you want to try other flags, you have to use them with the
-x
flag.
For example, if you wanted to do a remote "ls -lrt", you could
do this:
By default the program tries to open the remote host
and login anonymously, but you can specify a username
and password information like you can with
ncftpget
or
ncftpput.