CompTIA Study Materials
AWS Study Materials
AWS Cloud Practitioner AWS Cloud Practitioner
AWS Cloud Practitioner CLF-C02
Microsoft Study Materials
Microsoft Azure Fundamentals Microsoft Azure Fundamentals
Microsoft Azure Fundamentals AZ-900

Free CompTIA Linux+ XK0-005 Practice Question

Which command demonstrates the correct use of the '||' operator in a shell script to execute a backup script only if the primary backup command fails?

  • tar czf /backup/primary.tar.gz /data || /usr/local/bin/backup-fallback.sh

  • tar czf /backup/primary.tar.gz /data && /usr/local/bin/backup-fallback.sh

  • /usr/local/bin/backup-fallback.sh || tar czf /backup/primary.tar.gz /data

  • tar czf /backup/primary.tar.gz /data | /usr/local/bin/backup-fallback.sh

This question is for objective:
Scripting, Containers, and Automation
Your Score:
Scripting, Containers, and Automation
System Management
Security
Troubleshooting
SAVE $45