Linux command
dwdiff 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Compare two files word by word
dwdiff [file1.txt] [file2.txt]
Show only deletions and insertions
dwdiff -c [file1.txt] [file2.txt]
Use color output
dwdiff -c [file1.txt] [file2.txt]
Show line numbers
dwdiff -L [file1.txt] [file2.txt]
Ignore whitespace differences
dwdiff -w [file1.txt] [file2.txt]
Show statistics only
dwdiff -s [file1.txt] [file2.txt]
说明
dwdiff compares files word-by-word rather than line-by-line, making it easier to spot small changes in prose or documentation. It highlights deleted words (from the first file) and inserted words (in the second file). The tool is particularly useful for comparing text documents, translations, or any content where line-based diffs produce confusing output. It shows exactly which words changed between versions.
参数
- -c, --color
- Color output (default in terminals).
- -L, --line-numbers
- Show line numbers.
- -s, --statistics
- Print statistics at end.
- -w, --ignore-whitespace
- Ignore whitespace differences.
- -i, --ignore-case
- Case-insensitive comparison.
- -d _delimiters_
- Characters that delimit words.
- -P
- Use punctuation as delimiters.
- -1
- Read old file from stdin.
- -2
- Read new file from stdin.
- -3
- Use pager for output.
- --wdiff-output
- Produce wdiff-compatible output.
FAQ
What is the dwdiff command used for?
dwdiff compares files word-by-word rather than line-by-line, making it easier to spot small changes in prose or documentation. It highlights deleted words (from the first file) and inserted words (in the second file). The tool is particularly useful for comparing text documents, translations, or any content where line-based diffs produce confusing output. It shows exactly which words changed between versions.
How do I run a basic dwdiff example?
Run `dwdiff [file1.txt] [file2.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --color do in dwdiff?
Color output (default in terminals).