Searching File Contents of Remote Server via FTP
Solution 1
This does not work with FTP.
The reason is that FTP is a protocol for listing and transferring files only. Nothing more, nothing less. You can get the name of a file, or list a folder's files, or you can transfer it to your machine. You can't, however, peek into the file.
Searching the contents of the file would be a much more complicated task than just serving it. FTP is not designed to do this and will never allow this.
Do it over SSH if you can.
If you have access over SSH, you can send a remote command that would allow you to search within files. Download Cyberduck.app and connect to the server.
Then send a command using Option-Cmd-C.
grep -ri "something" /remote/folder
This would search for "something" within /remote/folder
and all of its children.
Have a look at some grep examples (here or here) to see how you could use it.
Solution 2
Um.. Don't have 50 reputation, StackExchange, sorry. You can search on a remote server through filezilla, via Server > Search remote files (Or just by pressing F3).
Related videos on Youtube
![Dan](https://i.stack.imgur.com/cVWgd.png?s=256&g=1)
Comments
-
Dan almost 2 years
I'm running OSX 10.7 and i'm looking for a way to search for a string in the contents of a file on a remote FTP server. I'd like to be able to run the search over ftp rather than having to download all the files, and then search them locally.
Is there an app for that, or a way i can do it from the terminal?
-
Rich Homolka almost 13 yearspossible duplicate of IS there an FTP tool that can search for a phrase in all the files in a directory?
-
-
Dan almost 13 yearsThanks for the clarification, and examples. In this case, the server in question is a shared hosting server, and I don't have SSH access. I was hoping there was a way to do it strictly over FTP instead.
-
vonbrand over 11 yearsUse what? Please complete your answer.
-
slhck over 11 years@vonbrand Using FileZilla. Granted, using a Windows VM just for an FTP client… but there's an OS X version.