Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Related to this question: http://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?

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

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

mdls -name kMDItemWhereFroms filename

share|improve this answer
add comment

According to this article about command line tricks you can do the following:

sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | grep YOURFILENAME

Just exchange YOURFILENAME with the file you want to check.

share|improve this answer
1  
why the down vote? A comment about it would be nice –  Pfitz Dec 6 '12 at 13:49
    
I don't think your answer fully applies to the question. That's probably the reason you got the downvote. –  patrix Dec 8 '12 at 20:21
    
@patrix the question is: can you get the same information from the command line. And you can get these informations with the above stated command. It may not be the best solution to the question but it is for sure an alternitve to lhf s answer. –  Pfitz Dec 8 '12 at 23:15
    
Only if the information is still (or was at all) in the database. –  patrix Dec 9 '12 at 9:21
    
@patrix and the file exists ..... the computer is turned on .. –  Pfitz Dec 9 '12 at 9:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.