5

How to compare files on ftp-server and in a folder in Linux?

3
  • 3
    how detailed a comparison do you need? Apr 12, 2010 at 10:52
  • i need to compare directory structure (n-level) with <10k files (name,extension,size) so, simple comparison
    – Vytas P.
    Apr 12, 2010 at 19:01
  • @quackquixote, What do you mean? Most file comparators do roughly about the same thing. He just need it to work with FTP.
    – Pacerier
    Jul 6, 2015 at 16:32

6 Answers 6

2

You can use the jdiff and ftp plugins in jEdit to do this (presuming the target files are text).

3

For folders i used Krusader and, with some success, WinSCP over WINE (and, with much more success, with WinSCP in Windows, in another machine, either real or virtual).

Small problems are, Krusader is going to have problems if files are 0 sized. Despite that, everything else work perfect.

In older distros or krusader versions, some dates are going to be shown incorrectly, making it believe local or remote copies are older than their cunterparts, due to time differences between time zones and local and server.

WinSCP is much more robust to deal with differences in time and other things, but it is slower and if path exceds the 256 characters lenght (a windows cronic issue) it is going to crash.

In another machine, you need to mount the Linux folder (via Samba or the VM folder share method) as a disk. That could also helps with the 256 characters path cronic illness on Windows apps.

I know the question is pretty old, but, it is one of the first results on google, so this is my 2 cents of contribution.

2

Try with

$ vimdiff local_file ftp://[user@]machine[:port]/remote_file

For example

$ vimdiff todo.txt ftp://[email protected]/todo.txt

The password, if needed, can be entered later.

1

You will need to use a bash script and compare file listings in the two places. You will need to make sure that the file listings are consistent so you can compare them.

1

Not the ideal solution, but Total Commander @ wine will do the task.

Other tools: http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools

1
  • How well is Wine performance?
    – Pacerier
    Jul 6, 2015 at 16:33
0

Could not get meld or kompare to use ftp://...

However if the ftp server is not to big you could use wget --mirror and then do the diff locally, I know it's not the best solution... but it may work.


I have not tried this but there seem to be a possibility to mount the ftp server, using ftpfs or fuse or something like that (see Mounting ftp host to local directory on top of FUSE or HOWTO: mount ftpfs under Linux).

Then you could use the normal diff tools since now the ftp server behaves like a local dir.

1
  • 1
    meld or kompare (or vim with netrw) will have to fetch the file, too, so everything you propose would be local anyway. Apr 12, 2010 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .