bash

Perl – Detect non-ASCII characters in file

Solution

$ perl -ne 'if (/[^[:ascii:]]/) { print $. . ": " . $_ }' filepath

 

Get file content from line x to line y

Solution

$ awk 'NR >= x && NR <= y' path/to/file