---

How to Check Exit Status for Command in Linux

When working on a Linux system, every command you run returns a status code (also called an exit status or return code) that tells you whether it ran successfully or failed.

As a Linux user, especially if you’re learning shell scripting or troubleshooting, knowing how to check the exit status of a command is super important.

In this article, I’ll explain what exit status means, how to check it, and why it matters.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis