I have 8 files in the linux operating system and i want to know which one of them is only-human readable file .
-file00 -file01 -file02 -file03 -file04 -file05 -file06 -file07 -file08 -file09how can i do this ?
11 Answer
If you're looking for files that match the text/plain MIME Type, then you could use file --mime-type, which will have a "best guess" at what the file is... pair that with grep and you might get a reasonable result.
# put the name of each file into the `files` variable
files=( * )
file --mime-type -- "${files[@]}" \ | grep -E ': +text/plain$'Note that file doesn't actually scan the entire file to make this "best guess" assessment, so you may get some false positives. Additionally, I'm not sure how it will deal with Unicode...
If you're after something else, then please revise your question with more detail on what you're after.
5