Skip to content

Instantly share code, notes, and snippets.

@somada141
Last active August 29, 2015 14:16
Show Gist options
  • Save somada141/ca262713bc28530cf740 to your computer and use it in GitHub Desktop.
Save somada141/ca262713bc28530cf740 to your computer and use it in GitHub Desktop.
Identify non-ASCII characters in a file #shell #unix #osx #perl

The following Perl command, which should work directly in a UNIX/OSX bash, checks a file and prints any line with a non-ascii character

perl -ne 'print "$. $_" if m/[\x80-\xFF]/'  file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment