TIL - 2023-04-10 // Chaining Bash Commands Sequentially

How to chain Bash commands in sequence using the && (and) operator

The && operator can be used to chain commands in the bash command line. The command sequence will only execute if the previous command completed successfully.

Practical Example usage: Switch to a directory and list its contents.

cd dir && ls