Created
August 5, 2023 20:40
-
-
Save alirezapla/2ff2d9e1e3aa802e8486d218920b2f89 to your computer and use it in GitHub Desktop.
disk usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
free=$(df -h / | tail -n 1 | awk '{print $4}') | |
total=$(df -h / | tail -n 1 | awk '{print $2}') | |
use=$(df -h / | tail -n 1 | awk '{print $5}') | |
echo Free/Total memory: $free / $total | |
echo Percentage: $use | sed 's/%//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment