OnCallReadyStart learning

exit: exit the shell

exit [N]

Examples

$ exit

leave this shell: an SSH session closes, a sudo -i / su shell drops back to your own user

$ exit 3

leave with status 3 - in a script, the caller sees it in $?

$ bash -c 'exit 3'; echo $?

prints 3: the exit status of the child shell

Gotchas

Taught in

Try exit in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.