What Is Exit Code 1 Linux?
Contents

The only general convention is that a zero exit status signifies success, whereas any non-zero exit status is a failure. Many — but certainly not all — command-line tools return exit code 1 for syntax error, i.e. you had too few arguments or an invalid option.

How do I exit code 1?

When a script that has been executed from the command line ends, a number is displayed in the command prompt window. This number is an exit code.
…
Command line exit codes.

Exit code Meaning
0 No error. The script executed successfully.
-1 A registry key or file required for Command Manager was not found.

What is exit code 1 in shell script?

You can use value of exit status in the shell script to display an error message or run commands.
…
List of common exit codes for GNU/Linux.

Exit Code Description
0 Success
1 Operation not permitted
2 No such file or directory
3 No such process
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest