8

I am logged in to an ftp server and want to find a particular directory within all the directories that exist there. I am looking for a command similar to the Unix find command. Is there something like this available?

Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
  • I don't think that's off-topic here as I asked myself that question in a professional setting. (Developers of software I use at work have changed the directory layout of their ftp server and I can't find some specific source code there anymore.) Plus, I'd have an answer not yet mentioned here: Many ftp servers have ls-lr.txt.gz files with indices of the server's contents. Downloading that one and grepping through is similar to the Unix command locate which again is similar to find, just with cached contents. – Axel Beckert Jan 19 '16 at 18:34

6 Answers6

7

There's lftp too. You can perform things like :

lftp user@ftp.domain.net:/> find . | grep WORD
Christophe Drevet
  • 2,012
  • 2
  • 18
  • 26
3

While theoretically possible I'm not aware of any ftp-client to support this.

EDIT: As idursun pointed out Total Commander can do it.

It's not possible with regular ftp, but if you have a shell account you can login with ssh or putty and use find.

If you really have only ftp-access you could try to list all directories recursively to a file and then grep.

Ludwig Weinzierl
  • 1,180
  • 1
  • 11
  • 22
1

Total Commander can do that. Connect to ftp using the built-in ftp client and perform a normal search (Alt+F7) in the ftp tab.

idursun
  • 101
  • 3
0

Some FTPd have a file database that can be queried:

user@ftp.domain.net:/> site search foo
/pub/beer/foo/
/pub/beer/foo/bar
petrus
  • 5,297
  • 26
  • 42
0

While there are ways to do this way client side, for example by getting a directory listing, and looping through those directory to get a list; theres no way to do this server side without altering the ftpd code. You arent in a shell server side, you certainly arent spawning a shell server side, so you cant use any commands server side that arent provided by the ftp server, as other answers show.

Sirch
  • 5,785
  • 4
  • 20
  • 36
-1

Mount the ftp folder locally using curlftpfs.