Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off-topic by Chris S Jun 27 '13 at 14:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about hardware or software used in a home setting are off-topic because they require answers that may not be practical for the business and support professionals here. You should try asking on Super User instead." – Chris S
If this question can be reworded to fit the rules in the help center, please edit the question.

    
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 at 18:34

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.

share|improve this answer

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.

share|improve this answer

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

lftp user@ftp.domain.net:/> find . | grep WORD
share|improve this answer

Some FTPd have a file database that can be queried:

user@ftp.domain.net:/> site search foo
/pub/beer/foo/
/pub/beer/foo/bar
share|improve this answer

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.

share|improve this answer

Mount the ftp folder locally using curlftpfs.

share|improve this answer