Difference between revisions of "Diff"

From wikieduonline
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{draft}}
+
{{lowercase}}
 +
<code>diff</code> compare files line by line
 +
* https://man7.org/linux/man-pages/man1/diff.1.html
  
  
 +
== Examples ==
 
* <code>diff -y file1 file2</code>
 
* <code>diff -y file1 file2</code>
* <code>diff -y --supress-common-lines file1 file2</code>
+
* <code>diff -y --suppress-common-lines file1 file2</code>
* <code>diff -y --supress-common-lines -W 200 file1 file2</code>
+
* <code>diff -y --suppress-common-lines -W 200 file1 file2</code>
  
  
 +
* <code>diff /path/to/DIRECTORY1/ /path/to/DIRECTORY2/</code>
 +
* <code>diff -r /path/to/DIRECTORY1/ /path/to/DIRECTORY2/</code>
 +
 +
* <code>diff -y file1.tf file2.bak --suppress-common-lines</code>
 +
 +
 +
== Related commands ==
 
* <code>[[docker container]] diff</code>
 
* <code>[[docker container]] diff</code>
 
* <code>[[virt-diff]]</code>
 
* <code>[[virt-diff]]</code>
 
+
* <code>[[kubectl diff]]</code>
 
+
* <code>[[rsnapshot-diff]]</code>
 +
* <code>[[git diff]]</code>
 +
* <code>[[git diff-tree]]</code>
 +
* <code>[[kubectl diff]]</code>
  
 
== See also ==
 
== See also ==
 
* {{grep}}
 
* {{grep}}
 
+
* {{diff}}
 +
* {{files}}
  
 
[[Category:Linux commands]]
 
[[Category:Linux commands]]

Latest revision as of 12:01, 8 January 2024

diff compare files line by line


Examples[edit]

  • diff -y file1 file2
  • diff -y --suppress-common-lines file1 file2
  • diff -y --suppress-common-lines -W 200 file1 file2


  • diff /path/to/DIRECTORY1/ /path/to/DIRECTORY2/
  • diff -r /path/to/DIRECTORY1/ /path/to/DIRECTORY2/
  • diff -y file1.tf file2.bak --suppress-common-lines


Related commands[edit]

See also[edit]

Advertising: