Skip to content

Instantly share code, notes, and snippets.

@kaito834
Created July 11, 2015 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaito834/575d757f1fb2d3bc9178 to your computer and use it in GitHub Desktop.
Save kaito834/575d757f1fb2d3bc9178 to your computer and use it in GitHub Desktop.
Compare two files on Windows instead of "diff" command; "fc" command or Compare-Object cmdlet
$>type diff-test_a.txt
This is test string.
hoge fuga.
This is test.
$>type diff-test_b.txt
This is test string.
This is test.
$>fc /N diff-test_a.txt diff-test_b.txt
ファイル diff-test_a.txt と DIFF-TEST_B.TXT を比較しています
***** diff-test_a.txt
1: This is test string.
2: hoge fuga.
3:
4:
***** DIFF-TEST_B.TXT
1: This is test string.
2:
*****
$>powershell
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
PS > Compare-Object (Get-Content .\diff-test_a.txt) (Get-Content .\diff-test_b.txt)
InputObject SideIndicator
----------- -------------
hoge fuga. <=
<=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment