HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

difft — Compare files or directories based on the syntax of the programming language. See also: `delta`, `di

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommanddifftfilesdirectoriesclicomparebased

Problem

How to use the difft command: Compare files or directories based on the syntax of the programming language. See also: delta, diff. More information: <https://difftastic.wilfred.me.uk/introduction.html>.

Solution

difft — Compare files or directories based on the syntax of the programming language. See also: delta, diff. More information: <https://difftastic.wilfred.me.uk/introduction.html>.

Compare two files or directories:
difft {{path/to/file_or_directory1}} {{path/to/file_or_directory2}}


Only report the presence of differences between the files:
difft --check-only {{path/to/file1}} {{path/to/file2}}


Specify the display mode (default is side-by-side):
difft --display {{side-by-side|side-by-side-show-both|inline|json}} {{path/to/file1}} {{path/to/file2}}


Ignore comments when comparing:
difft --ignore-comments {{path/to/file1}} {{path/to/file2}}


Enable/Disable syntax highlighting of source code (default is on):
difft --syntax-highlight {{on|off}} {{path/to/file1}} {{path/to/file2}}


Do not output anything at all if there are no differences between files:
difft --skip-unchanged {{path/to/file_or_directory1}} {{path/to/file_or_directory2}}


Print all programming languages supported by the tool, along with their extensions:
difft --list-languages

Code Snippets

Compare two files or directories

difft {{path/to/file_or_directory1}} {{path/to/file_or_directory2}}

Only report the presence of differences between the files

difft --check-only {{path/to/file1}} {{path/to/file2}}

Specify the display mode (default is `side-by-side`)

difft --display {{side-by-side|side-by-side-show-both|inline|json}} {{path/to/file1}} {{path/to/file2}}

Ignore comments when comparing

difft --ignore-comments {{path/to/file1}} {{path/to/file2}}

Enable/Disable syntax highlighting of source code (default is `on`)

difft --syntax-highlight {{on|off}} {{path/to/file1}} {{path/to/file2}}

Context

tldr-pages: common/difft

Revisions (0)

No revisions yet.