|
Home > Archive > Unix Shell > November 2006 > How Do I Get a Directory Listing via FTP?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How Do I Get a Directory Listing via FTP?
|
|
| jim evans 2006-11-29, 1:17 pm |
| If this is not the correct place to post this please direct me.
I want to fetch a directory listing using the Windows FTP facility.
In looking at the FTP commands I didn't find a DIR.
I know the basics of using the Windows FTP facility and know how to
go to the directory in question I just need a command the makes a
directory listing.
-- jim
| |
| Scott McMillan 2006-11-29, 1:17 pm |
| On Wed, 29 Nov 2006 10:36:16 -0600, jim evans
<jimsTAKEOUTnews2@houston.rr.com> wrote:
>If this is not the correct place to post this please direct me.
>
>I want to fetch a directory listing using the Windows FTP facility.
>In looking at the FTP commands I didn't find a DIR.
>
> I know the basics of using the Windows FTP facility and know how to
>go to the directory in question I just need a command the makes a
>directory listing.
>
>-- jim
Can vary depending on the FTP server you are connected to. DIR
probably won't fly on a *nix system, but dir (note lower case) as far
as I know is standard. Also, ls may be available to you.
Most FTP servers should respond to the "help" or "?" commands (no
quotes) to show you more options.
Scott McMillan
| |
| Todd H. 2006-11-29, 1:17 pm |
| jim evans <jimsTAKEOUTnews2@houston.rr.com> writes:
> If this is not the correct place to post this please direct me.
>
> I want to fetch a directory listing using the Windows FTP facility.
> In looking at the FTP commands I didn't find a DIR.
>
> I know the basics of using the Windows FTP facility and know how to
> go to the directory in question I just need a command the makes a
> directory listing.
ls (lowercase LS) is the command you want. It's the "dir" of *nix.
--
Todd H.
http://www.toddh.net/
| |
| jim evans 2006-11-29, 7:22 pm |
| On Wed, 29 Nov 2006 17:56:58 GMT, Scott McMillan
<smcmillan@twmi.rr.com> wrote:
>On Wed, 29 Nov 2006 10:36:16 -0600, jim evans
><jimsTAKEOUTnews2@houston.rr.com> wrote:
>
>
>Can vary depending on the FTP server you are connected to. DIR
>probably won't fly on a *nix system, but dir (note lower case) as far
>as I know is standard. Also, ls may be available to you.
dir worked. I don't know why I didn't just try that.
Thanks.
-- jim
| |
| Alan Curry 2006-11-30, 7:23 pm |
| In article <ruhrm2lkc32masirdvpk1488rokhl761m3@4ax.com>,
Scott McMillan <smcmillan@twmi.rr.com> wrote:
>On Wed, 29 Nov 2006 10:36:16 -0600, jim evans
><jimsTAKEOUTnews2@houston.rr.com> wrote:
>
>
>Can vary depending on the FTP server you are connected to. DIR
>probably won't fly on a *nix system, but dir (note lower case) as far
>as I know is standard. Also, ls may be available to you.
This is very misleading. The server has nothing to do with it. The commands
"ls" and/or "dir" are recognized by the client. Neither one of them is ever
seen by the server. The corresponding FTP protocol commands, which are
actually sent to the server to request listings, are NLST and LIST. The
classic ftp client translates ls to NLST and dir to LIST.
Newer versions of the client translate ls to LIST and require you to type
"nlist" if you want to see the listing in NLST format. The NetBSD CVS log
(http://cvsweb.netbsd.org/bsdweb.cgi.../cmds.c#rev1.86) has this
to say about it:
Change `ls' to use the `LIST' and not `NLST' FTP protocol command.
Now that after many years on not caring we find certain popular
ftp servers are starting to obey RFC959 to the letter of the law
and will only return a list of filenames (not directories or
other filetypes) in the output of `NLST', then `LIST' is more useful
in this case. (Note that the aforementioned pedanticness means that
filename completion isn't as useful as it could be...)
This 6-year-old change has probably not been applied to FTP.EXE, which is a
copy of some old BSD ftp. It's easier to imagine Micros~1 deprecating and
removing it than making an effort to maintain or modernize it.
So there are variations between servers in how they respond to NLST and LIST
commands, and variations among clients in how they interpret "ls", but the
server has no influence over the client's decision to recognize that "ls" is
a valid command. If your client has an "ls" command, it will have an "ls"
command regardless of what server you're connected to.
It's possible that some weird server doesn't support NLST; in that case you'd
get an error response from the server when you type "ls" in a traditional ftp
client while "dir" would work (assuming the weird server supports LIST). I've
never seen a server that weird, though.
>Most FTP servers should respond to the "help" or "?" commands (no
>quotes) to show you more options.
Although there is a HELP command in the FTP protocol, that's not what you get
if you type "help" at the "ftp>" prompt. You get the client's own built-in
help (try it while not connected to a server if need convincing). The
server's HELP response could be seen by typing "quote help", and it will
almost certainly include both NLST and LIST among the supported commands.
"dir" and "ls" will be nowhere in sight.
--
The attacker\x92s overall goal would very probably be to convince other users
to run an unsafe program, by using the digital signature to convince them
that it is actually bona fide Microsoft software and therefore safe to run.
-- security bulletin MS01-017 ushers in a new definition of "safe"
| |
| Allodoxaphobia 2006-11-30, 7:23 pm |
| On Thu, 30 Nov 2006 23:20:38 +0000 (UTC), Alan Curry wrote:
<interesting, good stuff snipped>
> The server's HELP response could be seen by typing "quote help", and
> it will almost certainly include both NLST and LIST among the
> supported commands. "dir" and "ls" will be nowhere in sight.
:
|ftp> quote help
|214-The following SITE commands are recognized
| ALIAS
| CHMOD
| IDLE
|214 Pure-FTPd - http://pureftpd.org/
|ftp>
:
|ftp> help quote
|quote send arbitrary ftp command
|ftp> quote NLST
|425 No data connection
|ftp> quote LIST
|425 No data connection
|ftp>
:
This on a FreeBSD server at my web hosting service.
However, ftp'ing into my own workstation: MDK 10.2 (proftpd):
:
|ftp> quote help
|214-The following commands are recognized (* =>'s unimplemented):
| CWD XCWD CDUP XCUP SMNT* QUIT PORT PASV
| EPRT EPSV ALLO* RNFR RNTO DELE MDTM RMD
| XRMD MKD XMKD PWD XPWD SIZE SYST HELP
| NOOP FEAT OPTS AUTH CCC* CONF* ENC* MIC*
| PBSZ PROT TYPE STRU MODE RETR STOR STOU
| APPE REST ABOR USER PASS ACCT* REIN* LIST
|214 Direct comments to root@nix2.IBMPEERS
|ftp> quote help LIST
|214 Syntax: LIST [<sp> pathname]
|ftp>
:
So , I learn something new each day.... :-)
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http//jonz.net/ng.htm>
|
|
|
|
|