Back to the command reference

false

ShellAdvanced In simulator In real Linux

Do nothing, unsuccessfully (exit code 1)

Name: false

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

false does nothing and exits with status 1 (failure). It is mostly used to test or demonstrate && and ||, or as a placeholder.

Syntax

false

Examples

  • $ false || echo failed

    The command after || runs

    Explain
  • $ false; echo $?

    Show the previous exit code

    Explain

Related