blob: 1582cc0540296b512bf6573a90377b69fe2e0ec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/bash
# Prints out the total disk memory and the available memory
PREFIX=' '
get_disk()
{
TOTAL_SIZE=$( df -h --total | tail -1 | awk {'printf $2'})
USED_SIZE=$(df -h --total | tail -1 | awk {'printf $3'})
PERCENTAGE=$(df -h --total | tail -1 | awk {'printf $5'})
echo "$PREFIX$USED_SIZE/$TOTAL_SIZE ($PERCENTAGE)"
}
get_disk
|