How can I perform an mdls query on a file?
Sometimes, we might ask you to perform an mdls query on a file to find out what it contains. It's not as scary as it sounds.
Here's how you can perform the mdls if you aren't a Powerpack user:
- Find out what the path to the file you want to perform an mdls on. In our example, we'll use Chrome, which is located in "/Applications/Google Chrome.app"
- Open Terminal
- Type mdls "/Applications/Google Chrome.app" (Include the quotes around the path as I've done in this example)
Have a look at the output and copy it for us to see if we have asked you to send it to us.
Otherwise, look at the kMDItemAlternateNames and kMDItemDisplayName to find out whether these match the app name correctly.
If they don't match or data appears to be missing, you may benefit from reindexing your Mac to allow this information to be refreshed. You can do this by clicking on the "Rebuild Index" button in the Advanced preferences.
Here's an alternative way to open Terminal to the correct location if you're a Powerpack user:
- Open the File Navigation in Alfred
- Navigate to the enclosing folder for the file you need
- Hit the right arrow to show result actions
- Choose "Open Terminal Here"
- Type mdls followed by the file name (You can type a few characters and hit Tab to auto-complete the file name)