I'm currently learning about the command cut, and specifically using cut with -f & -d.
If I run the command
ifconfig en1 | grep ether
I get the example output
If I only want the actual MAC address without the word "ether" I use the command
ifconfig en1 | grep ether | cut -f2 -d " "
using " " (a space) as the delimiter which gives me the MAC address only, which is the result I want.
The problem I am having is when trying to use this command to get only the capacity% of the hard drive.
If I type the command
and get the output
/dev/disk0s2 149Gi 91Gi 57Gi 62% /
I would guess that the command I would need to use to get only the capacity% (62%) would be :
df -h | grep /dev/ | cut -f5 -d "?"
My question is what would the delimiter be in this scenario, what would replace "?" in my example above. I'm guessing the fields in the output are delimited by a tab, but I'm not sure how to execute this. Can anyone help?