Miscellaneous
false
Do nothing and return a failure (non-zero) exit status.
Synopsis
syntax
false
Examples
Always prints 'failed'
false || echo 'failed'
Exit code is always 1
false; echo $?
Always takes else branch
if false; then echo y; else echo n; fi
About false
The `false` command do nothing and return a failure (non-zero) exit status. Utility commands cover a broad range of everyday tasks from date manipulation and arithmetic to terminal control and system documentation.
These tools fill in the gaps between major categories and are frequently used in shell scripts, cron jobs, and interactive sessions. The command accepts 0 commonly used flags shown above, though the full set of options is available in the man page (`man false`).
The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Miscellaneous Commands
Other commands in the Miscellaneous category