ncftpls [options] ftp://url.style/host/path/name/
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:
$ ncftpls -1
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:
$ ncftpls -x "-lrt"
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.
Note that the standard specifies that URL pathnames are are relative pathnames. For FTP, this means that URLs specify relative pathnames from the start directory, which for user logins, are typically the user's home directory. If you want to use absolute pathnames, you need to include a literal slash, using the "%2F" code for a "/" character. Examples:
$ ncftpls -u linus ftp://ftp.kernel.org/%2Fusr/src/ $ ncftpls ftp://steve@ftp.apple.com/%2Fetc/
ncftpls returns the following exit values:
Mike Gleason, NcFTP Software (http://www.ncftp.com).
ncftpput(1), ncftpget(1), ncftp(1), ftp(1), rcp(1), tftp(1).
LibNcFTP (http://www.ncftp.com/libncftp/).