Finding human-readable files on Unix

Yiğit picture Yiğit · Jan 24, 2013 · Viewed 70.3k times · Source

I'd like to find human-readable files on my Linux machine without a file extension constraint. Those files should be of human sensing files like text, configuration, HTML, source-code etc. files. Is there a way to filter and locate?

Answer

Blam picture Blam · Feb 3, 2016

Use:

find /dir/to/search -type f | xargs file | grep text

find will give you a list of files.

xargs file will run the file command on each of the lines from the piped input.