What does `set -x` do?

BeginnerConceptLinux and shell
Answer

It prints each command, after expansion, before running it. It's the quickest way to debug a Bash script. Turn it off with set +x.

All Real-World Interview questions Roadmap: Interview readiness

More on Linux and shell