Home » Questions » Computers [ Ask a new question ]

How long is long for the Unix 'file' command?

How long is long for the Unix 'file' command?

When you pass a text file to the Unix file command, it might tell you something like:

Asked by: Guest | Views: 129
Total answers/comments: 1
bert [Entry]

"Brute force (plus this is a program, right? so it makes it programming related?):

$ for i in {1..301}; do printf ""%${i}s"" ""."" | file - | grep very && echo $i; done
/dev/stdin: very short file (no magic)
1
/dev/stdin: ASCII text, with very long lines, with no line terminators
301"