DELAPARRA
Index
Color
NL
Category: CLI flags

-x, --exclude, -x (trace) (Extract / Exclude / Trace)

Explained by Updated

What is -x, --exclude, -x (trace) (Extract / Exclude / Trace)?

-x, --exclude, -x (trace) (Extract / Exclude / Trace): Extracts an archive, excludes a pattern from an operation, or turns on shell execution tracing — three unrelated meanings sharing one letter. -x has at least three unrelated meanings. In tar -xf archive.tar it extracts files. In rsync --exclude and zip -x it leaves matching files out. In bash -x script.sh, or set -x inside a script, it prints every command before it runs.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about -x, --exclude, -x (trace) (Extract / Exclude / Trace)

How is -x, --exclude, -x (trace) (Extract / Exclude / Trace) used in practice?

The tracing meaning is the one worth knowing for debugging. When a shell script fails and you cannot see why, add set -x near the top. You will see each line with its variables already filled in, which usually shows the wrong path or empty value straight away.

What should you keep in mind with -x, --exclude, -x (trace) (Extract / Exclude / Trace)?

Remove it again when you are done. A trace prints everything, including tokens and passwords that pass through variables. That is fine on your own machine, but not in a CI log that a whole team or the public can read.

At a glance

CategoryCLI flags
Explained by
Updated

More CLI flags terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.