close a mac terminal

Is there a trick to closing a mac terminal with a command? I would think you could just type exit into your terminal but that doesn't work. I also tried quit and close just for the hell of it and that didn't work either. Does anyone know what the command is?

If you are trying to close a Terminal window then configure the Terminal preferences: Settings > Shell . Set "When the shell exits:" to "Close the window" and "Prompt before closing" to "Never". When you type "exit" the window will close.

If you want to quit the Terminal application then configure the preferences as above and use this command->

osascript -e 'tell application "Terminal" to quit'