PowerShell get number of lines of big (large) file

前端 未结 8 1198
小鲜肉
小鲜肉 2020-12-23 16:35

One of the ways to get number of lines from a file is this method in PowerShell:

PS C:\\Users\\Pranav\\Desktop\\PS_Test_Scripts> $a=Get-Content .\\sub.ps1         


        
8条回答
  •  庸人自扰
    2020-12-23 17:27

    MS DOS command FIND : $fileName = 'C:\dirname\filename.txt'
    CMD /C ('find /v /c "" "' + $fileName + '"')
    Other variations on the find command can be found on the docs.

提交回复
热议问题