Count lines of code

Windows Powershell

  • In Windows Powershell, navigate to the directory containing the files to count
  • Use the following command which will count the lines of code in all .R script files found within that directory
dir -Recurse *.R | Get-Content | Measure-Object -Line