I am trying to find the name of my harddisk using OSX terminal using the system_profiler
command. I'm sending the output to a text file. Here is part of the output...
Serial-ATA:
Intel ICH8-M AHCI:
Vendor: Intel
Product: ICH8-M AHCI
Link Speed: 1.5 Gigabit
Negotiated Link Speed: 1.5 Gigabit
Description: AHCI Version 1.10 Supported
FUJITSU MHY2160BH:
Capacity: 160.04 G
The part I am after is the FUJITSU MHY2160BH:
, so I would like to grep the first line that starts with 16 spaces AFTER the Serial-ATA:
. As the output of system_profiler
has a variable number of lines, I don't really want to use grep -A
.
I've tried all manner of greps, awks and seds but to no avail.
Any thoughts? Cheers.