I've often found files on my system (particularly papers) whose provenance is uncertain. Safari has attempted to address this issue by adding metadata to every file it downloads. You can see this info by executing "mdls -name kMDItemWhereFroms file_name" on the downloaded file.
Unfortunately, this doesn't work when using wget or curl to get a file. To duplicate this, you can use the 'xattr' utility. This utility is limited, in that it cannot set a metadata value to a list, so I use the slightly different key of kMDItemWhereFrom (no "s").
Using a little bit of sed to get the filename, I use the following script in place of wget:
for i in $*
if [ -z `echo $i | grep '^-'` ]; then
export urls="$urls $i"
export switches="$switches $i"
for u in $urls
export fx=`echo $u | sed 's#^.*/##'`
export file=`echo $fx | sed 's/\?.*//
wget $switches $u
if [ $file != $fx ]
mv "$fx" "$file"
if [ ! -e "$file" ]
echo "Unable to find file: \"$file\" expected from url: $u"
xattr -w 'com.apple.metadata:kMDItemWhereFrom' "$u" "$file"