← cd ~/posts
Mar 19, 2014 #shell

Command Chaining

# chaining operators

Command chaining permits the execution of multiple commands in sequence — and execution based on the success or failure of a previous command.

cat 123.txt; ls -l runs first command, then second, regardless of exit status of the first
cat 123.txt && ls -l runs second command only if the first succeeds
cat 123.txt || ls -l runs second command only if the first fails
← back to all posts