Given the following substring given obtained from the command
df /dev/sdb1 | tail -n 1 :
/dev/sdb1 1952971772 1441131032 511840740 74% /media/kaiman/ShareData
I'd like to extract
74% from that string, to use it in a bash script.
I know I could use some cut commands or something, but it won't work anymore if a size changes, for example.
I also had thoughts about using a regex or something, but I'd like to have the most recommended approach.
Thanks in advance!