This is the story of a need:
I had a simple problem, a lot of files (not images) that looked the same and needed to be sure I wasn't going to loose anything if I deleted them.
I use Linux for several years now, but when I'm on Windows I never hang around without usingTotal Commander, a great side by side FS explorer tool. Is full of useful stuff. One of them isCompare by content
. I'll compare 2 files and state they are identical or show the diff output on a special interface for that.
On Android, gladly, we have Total Commander as well 😄 . Is a must have, seriously. But is now as packed as the original version. Anyway, is powerfull enough to solve my dilema.
The dilema: bunch of unknown files that looked the same
I was browsing and doing some cleaning in the internal when I found this:
A lot of files that looked the same, judging by their size. But how to be sure they were the same.
If I were in Windows I'll had the tools; If I were on Linux, I would havediff
, but I'm on Android... wait... Isn't Android a form of Linux?
Diff on Android, which is a sort of Linux (awwwwww, so cool!)
So I went to my trustedTerminal app and issue the command:
$ diffSee diff --helpdiff: Need 2 arguments
Wow, there it is. So, just need to use this to compare the files and get the results. But there are a few of them.
Total Commander to the rescue!
Total Commander has the capability of adding buttons to its toolbar (you can see it at the bottom of the image). Pressing the+
sign you'll get a dialog like the next one, where you'll press theFunction type:
Of many things you can choose there is a choice to pass arguments to a command. SelectingSend shell command
:
Once there is time to tweak on theParameters:
field. If you hit the?
button you'll find the explanation, but to resume:
- The field is a multiline field: one parameter per line
- If the first parameter is an
*
it will output the results in a dialog that can be copied to clipboard. - Using
%S
will include the names of selected files in parameter line
So, knowing this theParameteres
field goes like this:
*diff %S
So, lets select 2 obviusly different files and try it:
The result:
This is just GREAT!
The result on equal files
Now let's go for the similar files:
Now pay attention because the result will be showed on screen for a short period of time and is:
Wow, you were lucky to be looking at an static image, otherwise you'll had miss it 😆.
In this case when files are identical the output of thediff
command isnull, nada, zero. You get me? That's why it prints nothing to a dialog, just theFunction succeeded!
overlay message.
Well, that's about it. Be carefull when comparing coding files, because the whole diff output will be on the dialog, and you know it can get long.
If you like this post hit thelike orheart oryou know button. Thank you all!
Top comments(1)

- LocationPrague, Czech republic
- Pronounshe/him
- WorkSoftware Engineer at Microsoft
- Joined
That's not very useful solution, unfortunately. But Total Commander for Android has (like the Windows version) a built-in feature to compare two files already implemented. Simply add a new button as described in this article, but instead of the "Send shell command" function type, select the "Internal command" and "161 Compare selected files" as a command. That's it.
Unfortunately, it's not very useful as well, because it looks like it shows only the first detected difference. At least it's displayed in a dialog window rather than a toast message, so it doesn't disappear after a second.
For further actions, you may consider blocking this person and/orreporting abuse