0

Is there a neater way to list hard drives with fdisk?

If I run fdisk -l I get the Disk, Units, Sector size, I/O size, etc - all distracting stuff.

I can run fdisk -l | grep "Disk /" but this seems a bit of a hack. Is there a better way?

====

UPDATE

I thought I'd made myself perfectly clear. I'd given examples of what I didn't want and what I did want in the subsequent two lines of my question.

By neater I mean just listing the hard drives (i.e. Disk /dev/xvdb - see line 3 of my question) without all distracting stuff like Disk, Units, Sector size, I/O size (see line two of my question). i.e. not this:

8589 MB, 8589934592 bytes, 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I feel like I'm repeating myself.

Snowcrash
  • 1,137
  • 2
  • 17
  • 19

1 Answers1

2

You have not described what you mean by "neater way" however simply to get a list of block devices is to list them:

ls -1 /sys/block/
TimB
  • 193
  • 2
  • 10