Source From Here
Question
How do I determine the file type under UNIX or Linux like operating systems?
How-To
You need to use the file command to determine file type. File command tests each argument in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed on screen.
file Command Examples
First example:
Another example:
Or let's test C source file:
How about binary file:
Even the device files:
Question
How do I determine the file type under UNIX or Linux like operating systems?
How-To
You need to use the file command to determine file type. File command tests each argument in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed on screen.
file Command Examples
First example:
Another example:
Or let's test C source file:
How about binary file:
Even the device files:
沒有留言:
張貼留言