Terminal command to get all of a file's metadata?
This response might be late, but hopefully it will help someone.

There are numerous ways to view metadata in the terminal on an Apple computer:


mdls path/file.extension


mdls stands for Metadata List and you can look at the man pages (man mdls) to learn how to use it.

xattr path/file.extension


xattr stands for Extended Attributes. This can be used to display and edit extended attributes of files.
xattr -l path/file.extension causes the attribute names and values to be displayed. However, I've noticed that, at least on macOS, it seems that this only displays user-added data.

ls -l@ path/file.extension


ls is a powerful terminal listing utility. In its simplest form it lists the current directory contents. However, as you can see here you can list more than that.

exiftool path/file.extension


You need to install exiftool separately if you haven't already.  For example, if you use brew, you can do brew install exiftool.
exiftool is a useful utility for viewing and messing around with file metadata.

sips -g all path/file.extension (for images)


sips and identify are both for reading image metadata/info.

identify -verbose path/file.extension (for images)


Depending on your desired application, one of these might be more appropriate or convenient than the others. However, it should be noted that these all show different things, even if slightly.