Don't forget about "open -b <bundle_id> foo.txt" for example,
open -b com.sublimetext.4 file.txt
I prefer this vs using the App Name or Path, since those can vary depending on the system or app version. The bundle ID is more robust.