How to “Get Info” from the command line

command line

Related to this question: https://superuser.com/q/514528/90435

Via http://osxdaily.com/2010/10/12/find-out-where-a-file-was-downloaded-from/ I find out that you can use 'get info' though Finder to find out where a file was downloaded from.

For example –
enter image description here

Now – my question is – can I get the same information from the command line?

Best Answer

mdls lists the metadata attributes of a given file. Try this:

mdls -name kMDItemWhereFroms filename