How to find out if iTerm is installed on a mac from within a shell script? I am writing an automated script that will install iTerm2 if it's not already installed. What's a good way of checking if iTerm2 is already installed?
The open command will open it no matter where the person has it installed (you don’t have to put an app in /Applications on macOS). 

open -a iTerm.app


You could search using spotlight as well

 mdfind "kMDItemCFBundleIdentifier == com.googlecode.iterm2"