Ever visited one of those sites that downloads a file with a Javascript or some other active method, and you wind up with a file named "download.asp" or "file.asp"? Ever wonder how to figure out what it is, without trying to drag-and-drop it on everything?
In the terminal, it's quite simple - you can use the file command, like this:
[xperiment:~/Documents/downloads] berto% file download.php(Line break added to shorten the line width!) The file command looks at the file, and compares it to a database of types, and then gives you its best guess at the filetype.
download.php: gzip compressed data, deflated,
last modified: Fri Feb 23 18:17:34 2001, os: Unix
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010306232840501