How can I quit an app using Terminal? I want to quit certain applications on my Mac using Terminal. For example, how do I kill “Slack”? Do I need its PID number?
You can use AppleScript to tell the application to quit:

osascript -e 'quit app "Slack"'


this will tell the application to quit and will start all the save and cleanup tasks. Or you can send the TERM signal with pkill but it could be that the application will not shut down cleanly

pkill -x Slack