Skip to content

Instantly share code, notes, and snippets.

@dbrugne
Created July 21, 2023 07:31
Show Gist options
  • Save dbrugne/7300e4763c1b05448d28ce018f87006b to your computer and use it in GitHub Desktop.
Save dbrugne/7300e4763c1b05448d28ce018f87006b to your computer and use it in GitHub Desktop.
Detect files encoding by CLI
# install dep
npm i -g detect-file-encoding-and-language
# one file
dfeal myfile.txt
# file in folder
find ./myfolder -maxdepth 1 -type f -printf '%p' -exec dfeal {} \;
# recursive
find . -name "*.*" -type f -printf '%p' -exec dfeal {} \;
# recursive with pattern
find . -name "*.txt" -type f -printf '%p' -exec dfeal {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment