Recall & Review
beginner
What command in bash can you use to check disk space usage?
You can use the
df command to check disk space usage in bash. It shows the amount of disk space used and available on filesystems.Click to reveal answer
beginner
What does the
-h option do when used with the df command?The
-h option makes the output human-readable by showing sizes in KB, MB, or GB instead of blocks.Click to reveal answer
beginner
In a disk space monitoring script, why do we compare disk usage against a threshold?
We compare disk usage against a threshold to know when disk space is running low. This helps to alert or take action before the disk is full.
Click to reveal answer
intermediate
What bash command can be used to send an alert email from a disk space monitoring script?
You can use the
mail or sendmail command to send an alert email from a bash script when disk space is low.Click to reveal answer
intermediate
How can you schedule a disk space monitoring script to run automatically every day?
You can schedule the script using
cron by adding a cron job that runs the script daily at a set time.Click to reveal answer
Which command shows disk space usage in a human-readable format?
✗ Incorrect
The
df -h command displays disk space usage with sizes in KB, MB, or GB.What is a common threshold percentage to alert for low disk space?
✗ Incorrect
80% disk usage is a common threshold to alert administrators before disk space runs critically low.
Which bash command can be used to extract just the disk usage percentage from
df output?✗ Incorrect
awk is commonly used to parse and extract specific columns like disk usage percentage from df output.How do you schedule a script to run every day at 2 AM using cron?
✗ Incorrect
The cron expression "0 2 * * *" runs the script at 2:00 AM every day.
What is the purpose of sending an email alert in a disk space monitoring script?
✗ Incorrect
Email alerts notify administrators so they can take action before disk space runs out.
Describe how a basic disk space monitoring script works in bash.
Think about checking disk space, comparing it, and alerting.
You got /4 concepts.
Explain how to automate running a disk space monitoring script daily.
Automation uses cron jobs in Linux.
You got /4 concepts.