This command can be used when you want to get a list of files containing double-byte characters in a certain folder.
It can be used when it is necessary to translate Japanese comments into English for a project when OSS is released.
This can be achieved by detecting non-ASCII characters with a regular expression.
find [Search symmetric folder path] -type f | LANG=C xargs grep -n -v '^[[:cntrl:][:print:]]*$' --binary-files=without-match
If you want to target only files with a specific extension, type the following command.
find [Search symmetric folder path] -type f -name "*.[Extension you want to search]" | LANG=C xargs grep -n -v '^[[:cntrl:][:print:]]*$' --binary-files=without-match
Recommended Posts