command-line-reference.md
This file
Path
docs/command-line-reference.md
41 lines · 881 bytes · Markdown
Last changed by
Add reference doc for primers on command line topics.Edward Gbefore adoptionaeb1168
History of this fileTake it
command-line-reference.md
General Command Line Topics
---
depth: 2
local: true
---
Exit Codes
When a command is executed from the command line, then an exit code is return. The exit code, also called exit status or exit status code, is a integer that tells you whether the command executed without errors or with errors. Exit code 0 means the command executed without errors. All of the other exit codes are defined by the Operating System, Shell, and/or command.
To access the exit code, execute the command, then do the following depending:
.. tabs::
.. group-tab:: Powershell
.. code-block:: powershell
> echo $LASTEXITCODE
.. group-tab:: Bash
.. code-block:: bash
$ echo $?
.. group-tab:: Command Prompt
.. code-block:: text
> echo %ERRORLEVEL%