Count number of lines in the files using PowerShell
Files with java extension
Get-ChildItem "*" -Filter *.java | ForEach-Object { Get-Content $_.FullName | Measure-Object -line }
Get-ChildItem "*" -Filter *.java | ForEach-Object { Get-Content $_.Name | Measure-Object -line }
dir * -recurse | select Fullname,@{name="LineCount";expression={ @(get-content $_.fullname).count }}
dir * -recurse | select Name,@{name="LineCount";expression={ @(get-content $_.fullname).count }}
፠ Looks like it ignores empty lines.
ls -R *.java | % { $_ | select name, lastwritetime, @{n="lines";e={ get-content $_ | measure-object -line | select -expa lines } } } | ft -AutoSize
ls -R | Where {$_.extension -in ".java", ".xml", ".jsp", ".js"}
ls -R *.java,*.xml
댓글
댓글 쓰기