如何在PowerShell中比较两个.js文件

时间:2015-09-17 21:44:07

标签: javascript git powershell github

我正在使用Udicity的免费GitHub教程,我正在尝试使用powershell比较两个.js文件。

命令行:

C:\用户\ BOBBY1 \ Udacity \ gitAndGitHub>

文件是:

game_old.js

game_new.js

我需要在命令行输入什么命令来比较它们?他们在教程中建议的“FC”命令似乎不起作用。

1 个答案:

答案 0 :(得分:1)

fc是PowerShell的Format-Custom cmdlet的别名:

Get-Alias -Name 'fc'

CommandType     Name                             Version    Source
-----------     ----                             -------    ------
Alias           fc -> Format-Custom

要使用Windows的fc命令,您应键入fc.exe file1 file2,并在评论中提及Mark

compare files with PowerShell,请使用Compare-Object

Compare-Object (Get-Content file1.txt) (Get-Content file2.txt) | 
    Sort { $_.InputObject.ReadCount }
相关问题