How to get file metadata?
You can list all the metadata attached to a file with the mdls command

See this answer for a sample https://apple.stackexchange.com/a/165098/19086

ls -l@ will show which extended attributes are attached to a file