🎖️🏵️ Memorial Weekend Sale — 30% off🏵️🎖️

2 days, 1 hour remaining!
CompTIA Study Materials
AWS Study Materials
AWS Certified Developer Associate AWS Certified Developer Associate
AWS Certified Developer Associate DVA-C02
AWS Certified Solutions Architect Associate AWS Certified Solutions Architect Associate
AWS Certified Solutions Architect Associate SAA-C03
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

A system administrator needs to write a shell script that will output 'Large file detected' if a specified file size exceeds 1024 kilobytes. Which of the following shell script code blocks is the BEST to accomplish this?

  • if [ $(stat -c%s "file.txt") -gt 1048576 ]; then echo 'Large file detected'; fi

  • if [[ $(stat -c%s "file.txt") -gt 1024 ]]; then echo 'Large file detected'; fi

  • if [ $(stat -c%s "file.txt") / 1024 -gt 1024 ]; then echo 'Large file detected'; fi

  • if [ $(stat -c%s "file.txt") -gt 1024 ]; then echo 'Large file detected'; fi

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