SHARE
Facebook X Pinterest WhatsApp

How to Check Exit Status for Command in Linux

Written By
T
TecMint
Sep 23, 2025

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.

T

TecMint

Recommended for you...

KDE Gear 25.08.3 Is Out with More Bug Fixes, KDE Gear 25.12 Coming December 11th
Marcus Nestor
Nov 18, 2025
Linux Mint Devs Introduce New System Administration & System Information Tools
Marcus Nestor
Nov 18, 2025
Calibre 8.14 Open-Source E-Book Manager Updates the Tolino Driver and Fixes Bugs
Marcus Nestor
Nov 18, 2025
How to Install MongoDB on Debian 13
RoseHosting Blog
Nov 18, 2025
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.