Exit is the system command used to close a shell you're in. It is also very frequently used for exiting other command-line-ish environments, such as FTP clients or the mysql server. Ctrl-D will do the same thing as typing in exit.