exit command in Linux with Examples Read Courses Improve Improve Improve Like Article Like Save Article Save Report issue Report exit command in linux is used to exit the shell where it is currently running. It takes one more parameter as [N] and exits the shell with a return of status N. If n is not provided, then it simply returns the status of last command that is executed. Syntax: exit [n] Options for exit command – exit: Exit Without Parameter After pressing enter, the terminal will simply close. exit [n] : Exit With Parameter After pressing enter, the terminal window will close and return a status of 110. Return status is important because sometimes they can be mapped to tell error, warnings and notifications. For example generally, return status – “0” means the program has executed successfully. “1” means the program has minor errors. exit n : Using “sudo su” we are going to the root directory and then exit the root directory with a return status of 5. After returning it will show how to display the return status code. echo $? command is used to see the last return status. exit –help : It displays help information. Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now! Looking for a place to share your ideas, learn, and connect? Our Community portal is just the spot! Come join us and see what all the buzz is about! Last Updated : 22 Nov, 2022 Like Article Save Article Previous exit command in Linux with Examples Next expect command in Linux with Examples Share your thoughts in the comments Add Your Comment Please Login to comment...