Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

set

Set or unset shell options and positional parameters

Syntax

set [--abefhkmnptuvxBCHP] [-o option-name] [ARG]...

Common Options

-eExit on command error
-uError on undefined variable
-xPrint executed commands (debug)
-o pipefailPipeline fails if any command fails
-aAuto-export all variables
-nRead commands but don't execute
-fDisable filename globbing
-vShow shell input lines
--End options, rest are arguments
+eDisable -e option

Common Examples

set -e

Exit on error

set -euo pipefail

Strict mode

set -x

Enable debug mode

set +x

Disable debug mode

set -- arg1 arg2

Set positional parameters

set -f

Disable glob expansion

set -a

Auto-export variables

set -o vi

Set vi edit mode

Related Commands

Related Tools

More Code & Dev Tools