I'm writing a simple script to monitoring the disk space in the / partition and I want to grep only numbers in my output.
tabbi@tabbi:~/scripts$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 234G 7,6G 214G 4% /
Let's say I want to remove the % from the Use column (or remove it everywhere); when I use df -h / | grep -v '%'
nothing is printed.
How can I exclude the % symbol from my output?
--output=used
option – Jeff Schaller Mar 09 '18 at 12:04