How can I quit an app using Terminal?
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