Pipelines and Command Chaining
Pipelines and Command Chaining
Pipelines connect the stdout of one process to the stdin of another:
cat /var/log/auth.log | grep "Failed password" | awk '{print $11}' | sort | uniq -c | sort -nrConditional Execution: && and ||
# Execute second command ONLY if first succeeds:
mkdir -p /tmp/deploy && cp dist.tar /tmp/deploy/
# Execute second command ONLY if first fails:
systemctl status nginx || systemctl restart nginx