exit
Quick Reference
Command Name:
exit
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Script termination
End script execution with a specific status code
- 2
Error handling
Exit scripts when errors occur to prevent further processing
- 3
Shell termination
Close the current shell session
- 4
Conditional termination
Exit scripts based on specific conditions or user input
Syntax
exit [OPTION]... [FILE]...
Options
| Option | Description |
|---|---|
-l |
Use a long listing format |
-a |
Show hidden entries starting with . |
-h |
Human-readable sizes |
-R |
List subdirectories recursively |
Examples
How to Use These Examples
The examples below show common ways to use the exit command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.