In Linux, the command sudo fdisk -l
produces an output that lists all the disks and partitions in the computer. Here is an example:
If I try to use sudo fdisk -l
in MacOS X 10.7.5, the output is the following one:
fdisk: illegal option -- l
usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk
-i: initialize disk with new MBR
-u: update MBR code, preserve partition table
-e: edit MBRs on disk interactively
-f: specify non-standard MBR template
-chs: specify disk geometry
-S: specify disk size
-r: read partition specs from stdin (implies -i)
-a: auto-partition with the given style
-d: dump partition table
-y: don't ask any questions
-t: test if disk is partitioned
`disk' is of the form /dev/rdisk0.
auto-partition styles:
boothfs 8Mb boot plus HFS+ root partition (default)
hfs Entire disk as one HFS+ partition
dos Entire disk as one DOS partition
raid Entire disk as one 0xAC partition
Is there a command in MacOS to replicate the behavior of fdisk -l
in Linux?
Best Answer
You can use the 'diskutil' tool for that: