Cause the shell to exit and save history.
Syntax exit [n] Key n Set the exit status to n
If n is omitted, the exit status is that of the last command executed. A trap on EXIT is executed before the shell terminates.
exit is a bash built in command.
Example
$ exit logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. [Process completed]
“An exit strategy is a means of escaping one's current situation, typically an unfavourable situation” - Wikipedia
Related macOS commands:
shell_session_delete_expired - Delete expired sessions when "You have exceeded the maximum number of shell sessions".
shell_session_save - Save shell sessions
shell_session_update - updated saved session
screen - Multiplex terminal, run remote shells via ssh
shutdown - Shutdown or restart macOS