true and false (commands)
| true | |
|---|---|
| Initial release | January 1979 |
| Operating system | Unix and Unix-like |
| Platform | Cross-platform |
| Type | Command |
true and false are shell commands that exit immediately with exit status 0 or 1, respectively. As a script sets its process exit status to the value of the last command it runs, these commands can be used to set the exit status of a script run. All Unix shells interpret an exit status of zero as success and non-zero (usually) as failure, so true sets success and false sets failure.
The commands are available in Unix-like operating systems.